Skip to content

Do not initialize when parse is already initialized #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Parse/src/main/java/com/parse/Parse.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* library.
*/
public class Parse {
private static final String TAG = "com.parse.Parse";

/**
* Represents an opaque configuration for the {@code Parse} SDK configuration.
*/
Expand Down Expand Up @@ -359,6 +361,10 @@ public static void initialize(Context context, String applicationId, String clie
}

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