Skip to content

Commit

Permalink
🐛 Prevent setting size of an undefined model
Browse files Browse the repository at this point in the history
Fixes #373
  • Loading branch information
abe33 committed Aug 20, 2015
1 parent aaf16b9 commit a3ce412
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/minimap-element.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ class MinimapElement extends HTMLElement
@requestUpdate()

@setAttribute('stand-alone', true) if @minimap.isStandAlone()
@minimap.setScreenHeightAndWidth(@height, @width) if @width? and @height?

@minimap

Expand Down Expand Up @@ -416,7 +417,7 @@ class MinimapElement extends HTMLElement
@width = @clientWidth
canvasWidth = @width

@minimap.setScreenHeightAndWidth(@height, @width)
@minimap.setScreenHeightAndWidth(@height, @width) if @minimap?

@requestForcedUpdate() if wasResized or visibilityChanged or forceUpdate

Expand Down

0 comments on commit a3ce412

Please sign in to comment.