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

Commit 60b4af5d authored by Adam Lesinski's avatar Adam Lesinski Committed by Android (Google) Code Review
Browse files

Merge "AssetManager: Guard against null in array retrieval"

parents b8ce4444 ba9576d9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -245,9 +245,12 @@ public final class AssetManager implements AutoCloseable {
     *
     * @param resId the resource id of the string array
     */
    final CharSequence[] getResourceTextArray(@ArrayRes int resId) {
    final @Nullable CharSequence[] getResourceTextArray(@ArrayRes int resId) {
        synchronized (this) {
            final int[] rawInfoArray = getArrayStringInfo(resId);
            if (rawInfoArray == null) {
                return null;
            }
            final int rawInfoArrayLen = rawInfoArray.length;
            final int infoArrayLen = rawInfoArrayLen / 2;
            int block;
+1 −1
Original line number Diff line number Diff line
@@ -5033,7 +5033,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                            try {
                                rawHints = a.getTextArray(attr);
                            } catch (NullPointerException e) {
                            } catch (Resources.NotFoundException e) {
                                rawString = getResources().getString(resId);
                            }
                        } else {