Skip to content

Commit

Permalink
fix(core): fix android scope null when init engine exception
Browse files Browse the repository at this point in the history
  • Loading branch information
etkmao authored and siguangli committed Jan 8, 2025
1 parent 7676518 commit a2aab0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@ void DestroyJsDriver(__unused JNIEnv* j_env,
scope_cv_map.erase(scope_id);
}
auto scope = GetScope(j_scope_id);
if (!scope) {
return;
}
auto engine = scope->GetEngine().lock();
FOOTSTONE_CHECK(engine);
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ private synchronized void restartEngineInBackground(boolean onReLoad) {
try {
mEngineContext = new HippyEngineContextImpl(domManager);
} catch (RuntimeException e) {
mEngineContext = null;
LogUtils.e(TAG, "new HippyEngineContextImpl(): " + e.getMessage());
notifyEngineInitialized(EngineInitStatus.STATUS_INIT_EXCEPTION, e);
return;
Expand Down

0 comments on commit a2aab0f

Please sign in to comment.