From 8fa34e86596f39eb436f596bf4d2dad6e8b22d7f Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 4 Apr 2017 17:59:32 +0200 Subject: [PATCH] Do not connect if we're not configured (otherwise a 'not connected' error pops up during the first app run). --- .../src/main/java/com/b44t/messenger/ApplicationLoader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MessengerProj/src/main/java/com/b44t/messenger/ApplicationLoader.java b/MessengerProj/src/main/java/com/b44t/messenger/ApplicationLoader.java index 66441226c..300a59ded 100644 --- a/MessengerProj/src/main/java/com/b44t/messenger/ApplicationLoader.java +++ b/MessengerProj/src/main/java/com/b44t/messenger/ApplicationLoader.java @@ -230,7 +230,9 @@ public class ApplicationLoader extends Application { // open() should be called before MessagesController.getInstance() as this also initilizes directories based upon getBlobdir(). File dbfile = new File(getFilesDirFixed(), "messenger.db"); MrMailbox.open(dbfile.getAbsolutePath()); - MrMailbox.connect(); + if( MrMailbox.isConfigured()!=0 ) { + MrMailbox.connect(); + } // create other default objects SharedPreferences mainPreferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);