diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java index 363e2a7876..6931dd8592 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java @@ -128,7 +128,8 @@ public class EditPoiData { if (oldValue == null || !oldValue.equals(value)) { changedTags.add(tag); } - tagValues.put(tag, value); + String tagVal = value != null ? value : ""; + tagValues.put(tag, tagVal); notifyDatasetChanged(tag); } finally { isInEdit = false; @@ -207,7 +208,8 @@ public class EditPoiData { public void updateTypeTag(String string, boolean userChanges) { checkNotInEdit(); try { - tagValues.put(POI_TYPE_TAG, string); + String val = string != null ? string : ""; + tagValues.put(POI_TYPE_TAG, val); if (userChanges) { changedTags.add(POI_TYPE_TAG); } @@ -216,7 +218,8 @@ public class EditPoiData { if (pt != null) { removeTypeTagWithPrefix(!tagValues.containsKey(REMOVE_TAG_PREFIX + pt.getEditOsmTag())); currentPoiType = pt; - tagValues.put(pt.getEditOsmTag(), pt.getEditOsmValue()); + String tagVal = pt.getEditOsmValue() != null ? pt.getEditOsmValue() : ""; + tagValues.put(pt.getEditOsmTag(), tagVal); if (userChanges) { changedTags.add(pt.getEditOsmTag()); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index 66991de60e..0a93dc3419 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -67,7 +67,6 @@ import net.osmand.osm.edit.OSMSettings; import net.osmand.osm.edit.Way; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; @@ -75,6 +74,7 @@ import net.osmand.plus.base.BaseOsmAndDialogFragment; import net.osmand.plus.osmedit.OsmPoint.Action; import net.osmand.plus.osmedit.dialogs.PoiSubTypeDialogFragment; import net.osmand.plus.osmedit.dialogs.PoiTypeDialogFragment; +import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -465,8 +465,8 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { } private String isTextLengthInRange() { - for (Entry s: editPoiData.getTagValues().entrySet()) { - if (s.getValue().length() > AMENITY_TEXT_LENGTH) { + for (Entry s : editPoiData.getTagValues().entrySet()) { + if (!Algorithms.isEmpty(s.getValue()) && s.getValue().length() > AMENITY_TEXT_LENGTH) { return s.getKey(); } }