Skip to content

Commit

Permalink
🐛 fix undefined crash when place don't have zip code
Browse files Browse the repository at this point in the history
  • Loading branch information
Danezis committed Aug 16, 2022
1 parent a7cc075 commit 9746c15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/SVGRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Container, PointArrayAlias, Rect, Svg, SVG } from "@svgdotjs/svg.js"
import { Container, off, PointArrayAlias, Rect, Svg, SVG } from "@svgdotjs/svg.js"
import '@svgdotjs/svg.panzoom.js'
import { VirtualGridEntry } from "./struct.class"
import { Box, BoxV } from "./Box.class"
Expand Down Expand Up @@ -99,7 +99,10 @@ export class SVGRenderer {
}
let cleanPlaceCode = function (place:string):string{
if(place != undefined){
return place.split(',')[1].trim()
let zip = place.split(',')[1]
if(zip != undefined) {
return zip.trim()
}
}
return ""
}
Expand Down

0 comments on commit 9746c15

Please sign in to comment.