File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -301,6 +301,10 @@ App* FindAppByName(const char* name) {
301301App* GetDefaultApp () { return g_default_app; }
302302
303303App* GetAnyApp () {
304+ if (g_default_app) {
305+ return g_default_app;
306+ }
307+
304308 MutexLock lock (g_app_mutex);
305309 if (g_apps && !g_apps->empty ()) {
306310 return g_apps->begin ()->second ->app ;
Original file line number Diff line number Diff line change 2020#include < cstring>
2121
2222#include " app/src/assert.h"
23+ #include " app/src/app_common.h"
2324#include " app/src/build_type_generated.h"
2425#include " app/src/embedded_file.h"
2526#include " app/src/include/firebase/app.h"
@@ -310,9 +311,8 @@ void ReleaseCredentialClasses(JNIEnv* env) {
310311}
311312
312313static JNIEnv* GetJniEnv () {
313- // The default App must always exist, and the JNI environment is the same
314- // regardless of App.
315- App* app = App::GetInstance ();
314+ // The JNI environment is the same regardless of App.
315+ App* app = app_common::GetAnyApp ();
316316 FIREBASE_ASSERT (app != nullptr );
317317 return app->GetJNIEnv ();
318318}
You can’t perform that action at this time.
0 commit comments