Skip to content

Commit

Permalink
[Fix] Do not save empty tags during updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sdesprez committed May 2, 2018
1 parent aeee414 commit 8b755b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/io/jawg/osmcontributor/model/entities/Poi.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.Map;
import java.util.Set;

import io.jawg.osmcontributor.utils.StringUtils;
import io.jawg.osmcontributor.utils.core.MapElement;
import timber.log.Timber;

Expand Down Expand Up @@ -425,8 +426,8 @@ public void applyChanges(Map<String, String> tagsMap) {

// Add the new tags to the Poi
for (Map.Entry<String, String> tagToAdd : tagsMap.entrySet()) {
//The default level is zero, we don't send this tag if it's the default value
if (!("level".equals(tagToAdd.getKey()) && "0".equals(tagToAdd.getValue()))) {
//The default level is zero, we don't send this tag if it's the default value. We also do not want to send an empty tag.
if (!("level".equals(tagToAdd.getKey()) && "0".equals(tagToAdd.getValue())) && !StringUtils.isEmpty(tagToAdd.getValue())) {
PoiTag tempPoiTag = new PoiTag();
tempPoiTag.setKey(tagToAdd.getKey());
tempPoiTag.setValue(tagToAdd.getValue());
Expand Down

0 comments on commit 8b755b0

Please sign in to comment.