[android] verify if text-field is not null before performing compatibility operations
This commit is contained in:
committed by
Łukasz Paczos
parent
39423cc653
commit
bb55bae76d
@@ -372,13 +372,18 @@ public class SymbolLayer 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) %>());
|
||||
|
||||
Reference in New Issue
Block a user