Merge "Add nullptr check" into oc-mr1-dev

am: b20694ab00

Change-Id: I090a1d0a4f0b2b5ec8c599d795995ea242c2a6ca
This commit is contained in:
John Reck
2017-09-27 19:50:07 +00:00
committed by android-build-merger

View File

@@ -159,8 +159,10 @@ public class Shader {
if (mNativeInstance == 0) {
mNativeInstance = createNativeInstance(mLocalMatrix == null
? 0 : mLocalMatrix.native_instance);
mCleaner = NoImagePreloadHolder.sRegistry.registerNativeAllocation(
this, mNativeInstance);
if (mNativeInstance != 0) {
mCleaner = NoImagePreloadHolder.sRegistry.registerNativeAllocation(
this, mNativeInstance);
}
}
return mNativeInstance;
}