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

Commit c8ddcddd authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Frameworks/base: Check before foreach in Script

According to the if below, ains == null is potentially valid. But
the foreach loop would throw a NullPointerException.

Change-Id: I4460fb1357eaa3abfe0ab9a21effb608f474ab51
parent 30fcd2aa
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -239,9 +239,11 @@ public class Script extends BaseObj {
                           FieldPacker v, LaunchOptions sc) {
        // TODO: Is this necessary if nScriptForEach calls validate as well?
        mRS.validate();
        if (ains != null) {
            for (Allocation ain : ains) {
                mRS.validateObject(ain);
            }
        }
        mRS.validateObject(aout);

        if (ains == null && aout == null) {