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
This commit is contained in:
@ -239,8 +239,10 @@ public class Script extends BaseObj {
|
||||
FieldPacker v, LaunchOptions sc) {
|
||||
// TODO: Is this necessary if nScriptForEach calls validate as well?
|
||||
mRS.validate();
|
||||
for (Allocation ain : ains) {
|
||||
mRS.validateObject(ain);
|
||||
if (ains != null) {
|
||||
for (Allocation ain : ains) {
|
||||
mRS.validateObject(ain);
|
||||
}
|
||||
}
|
||||
mRS.validateObject(aout);
|
||||
|
||||
|
Reference in New Issue
Block a user