Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when some Nodes have Description and others don't on Snippet display #327

Closed
IncorporateApps opened this issue Nov 21, 2016 · 1 comment

Comments

@IncorporateApps
Copy link

Summary:

When a kml file is badly formatted and some Nodes have name and description and others just name, onclick of the marker a NullPointerException is triggered at com.google.maps.android.kml.KmlRenderer$1.getInfoContents(KmlRenderer.java:592)

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

Steps to reproduce:

Load a KML file such as
<Placemark> <name>Ulmer Park - Brooklyn Public Library</name> <Point><coordinates> -73.98868209572987,40.59265312974389 </coordinates></Point> </Placemark><Placemark> <name>Hollis</name> <description>Test</description> <Point><coordinates> -73.76230411230962,40.720168429639706 </coordinates></Point> </Placemark>

Expected behavior:

Should display either both snippets over the marker, one with the Title and Description or None, but not crash. If the KML has all Nodes with both properties or just one property (name for example) the app does not crash, but it also does not show an Info Window

setMarkerInfoWindow
should be extended to include
} else if (hasName && !hasDescription || !hasName && hasDescription) {
if(hasName)
marker.setTitle(placemark.getProperty("name"));
else if(hasDescription)
marker.setTitle(placemark.getProperty("description"));

        createInfoWindow();

}

Observed behavior:

Crashes on Marker press /show info window

Device and Android version:
Nexus 5x, Android 6.0.1, maps util 0.4.4 and 0.4.5

@Libby713
Copy link
Contributor

Libby713 commented Dec 5, 2016

Fixed in 0d92651. Thanks for your great report!

@Libby713 Libby713 closed this as completed Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants