Kingjuli / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

OverlayItem.getWidth() causing NullPointerException if no marker #352

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

OverlayItem item = new OverlayItem("title", "desc", position);
//don't set a marker, to use default marker
int width = item.getWidth();

What is the expected output? What do you see instead?
Causes a NullPointer exception. 
This is because getWidth and getHeight don't check if this.mMarker is null. 

What version of the product are you using? On what operating system?
=> osmdroid 3.0.8

Not easy to solve, as default marker is not accessible in OverlayItem... Return 
0?

Original issue reported on code.google.com by mathieu....@gmail.com on 27 Jun 2012 at 9:30