Fix nullpointer exception

This commit is contained in:
Sander Deryckere 2012-08-09 10:10:24 +02:00
parent bb4864eefe
commit 46bca3b1bb
3 changed files with 6 additions and 1 deletions

View file

@ -47,7 +47,7 @@ public class Amenity extends MapObject {
this.site = entity.getTag(OSMTagKey.CONTACT_WEBSITE);
}
}
if (this.site.indexOf("://") == -1){
if (this.site != null && !this.site.startsWith("http://")){
this.site = "http://"+this.site;
}
}

View file

@ -106,6 +106,10 @@ public class OpeningHoursParser {
public String toString(){
StringBuilder s = new StringBuilder();
if (rules.isEmpty()) {
return "";
}
for (OpeningHoursRule r : rules) {
s.append(r.toString()).append("; ");
}

View file

@ -100,6 +100,7 @@ public class EditingPOIActivity implements DialogProvider {
}
private void showPOIDialog(int dialogID, Node n, AmenityType type, String subType) {
System.out.println("showing dialog: "+n.toString());
Amenity a = new Amenity(n, type, subType);
dialogBundle.putSerializable(KEY_AMENITY, a);
dialogBundle.putSerializable(KEY_AMENITY_NODE, n);