Bug:
5727901
Change-Id: Ic2323eca6bc6e77fe428f3602800799e7b996cce
static int nativeFocusCandidateLayerId(JNIEnv *env, jobject obj)
{
- const CachedFrame* frame;
+ const CachedFrame* frame = 0;
const CachedNode* node = getFocusNode(env, obj, &frame);
- if (!node)
+ if (!node || !frame)
+ return -1;
+ const CachedLayer* layer = frame->layer(node);
+ if (!layer)
return -1;
- return frame->layer(node)->uniqueId();
+ return layer->uniqueId();
}
static bool nativeFocusIsPlugin(JNIEnv *env, jobject obj)