Skip to content

Commit 2e15813

Browse files
hermanliangrogerhu
authored andcommitted
Do not initialize when parse is already initialized (#640)
* do not throw an exception when init parse more than once, just issue a warning * Revert "do not throw an exception when init parse more than once, just issue a warning" This reverts commit ddbc562. * do not initialize when parse is already initialized
1 parent e706c07 commit 2e15813

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Parse/src/main/java/com/parse/Parse.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
* library.
3535
*/
3636
public class Parse {
37+
private static final String TAG = "com.parse.Parse";
38+
3739
/**
3840
* Represents an opaque configuration for the {@code Parse} SDK configuration.
3941
*/
@@ -359,6 +361,10 @@ public static void initialize(Context context, String applicationId, String clie
359361
}
360362

361363
public static void initialize(Configuration configuration) {
364+
if (isInitialized()) {
365+
PLog.w(TAG, "Parse is already initialized");
366+
return;
367+
}
362368
// NOTE (richardross): We will need this here, as ParsePlugins uses the return value of
363369
// isLocalDataStoreEnabled() to perform additional behavior.
364370
isLocalDatastoreEnabled = configuration.localDataStoreEnabled;

0 commit comments

Comments
 (0)