mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-01 06:34:25 +02:00
Gracefully handle null values
This commit is contained in:
parent
be4bdf1d75
commit
7e803aeac9
@ -26,16 +26,14 @@ public class ExtMXSerializer extends MXSerializer implements ExtXmlSerializer {
|
|||||||
@Override
|
@Override
|
||||||
public void startDocument(String encoding, Boolean standalone)
|
public void startDocument(String encoding, Boolean standalone)
|
||||||
throws IOException, IllegalArgumentException, IllegalStateException {
|
throws IOException, IllegalArgumentException, IllegalStateException {
|
||||||
super.startDocument(encoding != null ? encoding : mDefaultEncoding,
|
super.startDocument(encoding != null ? encoding : mDefaultEncoding, standalone);
|
||||||
standalone);
|
|
||||||
this.newLine();
|
this.newLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeAttributeValue(String value, Writer out)
|
protected void writeAttributeValue(String value, Writer out) throws IOException {
|
||||||
throws IOException {
|
|
||||||
if (mIsDisabledAttrEscape) {
|
if (mIsDisabledAttrEscape) {
|
||||||
out.write(value);
|
out.write(value == null ? "" : value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
super.writeAttributeValue(value, out);
|
super.writeAttributeValue(value, out);
|
||||||
@ -55,8 +53,7 @@ public class ExtMXSerializer extends MXSerializer implements ExtXmlSerializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setProperty(String name, Object value)
|
public void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException {
|
||||||
throws IllegalArgumentException, IllegalStateException {
|
|
||||||
if (PROPERTY_DEFAULT_ENCODING.equals(name)) {
|
if (PROPERTY_DEFAULT_ENCODING.equals(name)) {
|
||||||
mDefaultEncoding = (String) value;
|
mDefaultEncoding = (String) value;
|
||||||
} else {
|
} else {
|
||||||
|
@ -34,7 +34,7 @@ public final class ResXmlEncoders {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String encodeAsResXmlAttr(String str) {
|
public static String encodeAsResXmlAttr(String str) {
|
||||||
if (str.isEmpty()) {
|
if (str == null || str.isEmpty()) {
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user