summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs13
1 files changed, 9 insertions, 4 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
index 0e6cad78f6..c6ae12b028 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
@@ -181,13 +181,18 @@ public class <%- camelize(type) %>Layer extends Layer {
if (propertyValue.isExpression()) {
return (PropertyValue<String>) propertyValue;
} else {
+ String text = null;
+
Formatted formatted = (Formatted) nativeGetTextField();
- StringBuilder builder = new StringBuilder();
- for (FormattedSection section : formatted.getFormattedSections()) {
- builder.append(section.getText());
+ if (formatted != null) {
+ StringBuilder builder = new StringBuilder();
+ for (FormattedSection section : formatted.getFormattedSections()) {
+ builder.append(section.getText());
+ }
+ text = builder.toString();
}
- return (PropertyValue<String>) new PropertyValue("text-field", builder.toString());
+ return (PropertyValue<String>) new PropertyValue("text-field", text);
}
<% } else { -%>
return (PropertyValue<<%- propertyType(property) %>>) new PropertyValue("<%- property.name %>", nativeGet<%- camelize(property.name) %>());