Skip to content

Commit

Permalink
Fix bug if subdivision name not present
Browse files Browse the repository at this point in the history
  • Loading branch information
herrtunante committed Jul 30, 2024
1 parent 4ccd8cd commit 14521ab
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.util.Objects;
import java.util.UUID;

import org.jooq.tools.StringUtils;

public abstract class AbstractLandUseSubdivision<F> implements Comparable<AbstractLandUseSubdivision<?>>{

protected LandUseCategoryEnum category;
Expand Down Expand Up @@ -82,6 +84,10 @@ public void setName(String name) {

@Override
public String toString() {
return getCategory().getCode() + " / " + getManagementType() + " / " + getCode();
// sometimes the name might be empty if it was not specified in the right language in the survey (i.e. the label is present for Italian but not English )
if( StringUtils.isEmpty( getName() ) ) {
return getCategory().getCode() + " / " + getManagementType() + " / " + getCode();
}
return getCategory().getCode() + " / " + getManagementType() + " / " + getName();
}
}

0 comments on commit 14521ab

Please sign in to comment.