diff options
author | Andreas Gampe <agampe@google.com> | 2015-03-18 23:50:25 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-03-18 23:50:25 +0000 |
commit | 3c4ca688ceeb26aa21b6b061d46de37fbe1f9107 (patch) | |
tree | 701d49fd4241c7b959aa387cc770bd6df58bcb99 /rs/java | |
parent | 2d5b2c7dc10755a2c329cbef2eefeaa4f6a68611 (diff) | |
parent | 1dae2f9341c05eee5d77489c579ffd621fbe108b (diff) | |
download | frameworks_base-3c4ca688ceeb26aa21b6b061d46de37fbe1f9107.zip frameworks_base-3c4ca688ceeb26aa21b6b061d46de37fbe1f9107.tar.gz frameworks_base-3c4ca688ceeb26aa21b6b061d46de37fbe1f9107.tar.bz2 |
am 1dae2f93: am 8df1bedc: Merge "Frameworks/base: Fix potential NPE in Script"
* commit '1dae2f9341c05eee5d77489c579ffd621fbe108b':
Frameworks/base: Fix potential NPE in Script
Diffstat (limited to 'rs/java')
-rw-r--r-- | rs/java/android/renderscript/Script.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java index 83aeedd..65056ac 100644 --- a/rs/java/android/renderscript/Script.java +++ b/rs/java/android/renderscript/Script.java @@ -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; |