diff options
| author | 2020-05-11 17:59:59 +0000 | |
|---|---|---|
| committer | 2020-05-11 17:59:59 +0000 | |
| commit | 01ab4a277fffec62fa72117d0b83d62b1888bf78 (patch) | |
| tree | bc886090b5690c30e8c4c89ef642c8007c69ded7 | |
| parent | 49b69b865504f0e2ba873bac16e56d160023dea0 (diff) | |
| parent | b66d04b0a207046b59ae0b40a4c435c22e8786bf (diff) | |
Merge "AChoreographer: Avoid potential NULL dereference" into rvc-dev
| -rw-r--r-- | libs/nativedisplay/AChoreographer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/nativedisplay/AChoreographer.cpp b/libs/nativedisplay/AChoreographer.cpp index ea51245ac6..e458b2ecfb 100644 --- a/libs/nativedisplay/AChoreographer.cpp +++ b/libs/nativedisplay/AChoreographer.cpp @@ -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; |