Frameworks/base: Fix potential NPE in Script

Bug: 19797138
Change-Id: I5cd9394bd2c0f7c044c1f2f24665384fa797cd97
This commit is contained in:
Andreas Gampe
2015-03-17 20:05:46 -07:00
parent 28e6aeca3a
commit ad555f91a0

View File

@ -251,9 +251,14 @@ public class Script extends BaseObj {
"At least one of ain or aout is required to be non-null.");
}
long[] in_ids = new long[ains.length];
for (int index = 0; index < ains.length; ++index) {
in_ids[index] = ains[index].getID(mRS);
long[] in_ids;
if (ains != null) {
in_ids = new long[ains.length];
for (int index = 0; index < ains.length; ++index) {
in_ids[index] = ains[index].getID(mRS);
}
} else {
in_ids = null;
}
long out_id = 0;