Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0995958f authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

Merge "Do not call parseInt if value is empty"

parents 5963fd86 9f9bf95d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1594,6 +1594,9 @@ public class XmlUtils {

    public static int readIntAttribute(XmlPullParser in, String name, int defaultValue) {
        final String value = in.getAttributeValue(null, name);
        if (TextUtils.isEmpty(value)) {
            return defaultValue;
        }
        try {
            return Integer.parseInt(value);
        } catch (NumberFormatException e) {
@@ -1617,6 +1620,9 @@ public class XmlUtils {

    public static long readLongAttribute(XmlPullParser in, String name, long defaultValue) {
        final String value = in.getAttributeValue(null, name);
        if (TextUtils.isEmpty(value)) {
            return defaultValue;
        }
        try {
            return Long.parseLong(value);
        } catch (NumberFormatException e) {