Add nullptr check

Bug: 65717856
Test: builds
Change-Id: I188d3366e956f087c6317ae0b56d5fb19a20708d
This commit is contained in:
John Reck
2017-09-27 09:30:30 -07:00
parent 73c93f02f7
commit 3885bf6f04

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;
}