Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01ab4a27 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AChoreographer: Avoid potential NULL dereference" into rvc-dev

parents 49b69b86 b66d04b0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -250,12 +250,12 @@ void Choreographer::registerRefreshRateCallback(AChoreographer_refreshRateCallba
    }
    if (needsRegistration) {
        JNIEnv* env = getJniEnv();
        jobject dmg = env->CallStaticObjectMethod(gJni.displayManagerGlobal.clazz,
                                                  gJni.displayManagerGlobal.getInstance);
        if (env == nullptr) {
            ALOGW("JNI environment is unavailable, skipping registeration");
            ALOGW("JNI environment is unavailable, skipping registration");
            return;
        }
        jobject dmg = env->CallStaticObjectMethod(gJni.displayManagerGlobal.clazz,
                                                  gJni.displayManagerGlobal.getInstance);
        if (dmg == nullptr) {
            ALOGW("DMS is not initialized yet: skipping registration");
            return;