dlsc-software-consulting-gmbh / GMapsFX

Java API for using Google Maps within a JavaFX application.
http://rterp.github.io/GMapsFX/
Apache License 2.0
319 stars 119 forks source link

NullPointerException when resizing Stage with not initialized GoogleMap #41

Open aliebelt opened 9 years ago

aliebelt commented 9 years ago

Hello,

if I start an application with a GoogleMapView inside and without internet connection at startup and I resize the stage a NPE is thrown

java.lang.NullPointerException
    at com.lynden.gmapsfx.GoogleMapView.mapResized(GoogleMapView.java:101) ~[GMapsFX-1.1.2.jar:?]
    at com.lynden.gmapsfx.GoogleMapView.lambda$new$3(GoogleMapView.java:81) ~[GMapsFX-1.1.2.jar:?]
    at com.lynden.gmapsfx.GoogleMapView$$Lambda$576/1519827285.invalidated(Unknown Source) ~[?:?]
    at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:349) [jfxrt.jar:?]
    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81) [jfxrt.jar:?]
    at javafx.beans.property.ReadOnlyDoubleWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:177) [jfxrt.jar:?]
    at javafx.beans.property.ReadOnlyDoubleWrapper.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:143) [jfxrt.jar:?]
    at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113) [jfxrt.jar:?]
    at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:147) [jfxrt.jar:?]
    at javafx.scene.web.WebView.resize(WebView.java:304) [jfxrt.jar:?]
    at javafx.scene.Node.resizeRelocate(Node.java:2920) [jfxrt.jar:?]
    at javafx.scene.layout.AnchorPane.layoutChildren(AnchorPane.java:363) [jfxrt.jar:?]
...
aliebelt commented 9 years ago

Beside that, it seems not to be possible to get GoogleMapView to work if the initial loading fails due to eg. not internet connection. Even if I enable the internet connection after startup.