Reference retrieved from reference manager may be null.

Fixes issue #3612379.
This commit is contained in:
akwizgran
2013-05-01 00:08:33 +01:00
parent 1aa701ceee
commit d24d4adf7f

View File

@@ -99,8 +99,12 @@ public class HomeScreenActivity extends RoboActivity {
showSpinner();
startService(new Intent(BriarService.class.getName()));
bindService();
storeLocalAuthor(referenceManager.removeReference(handle,
LocalAuthor.class));
LocalAuthor a = referenceManager.removeReference(handle,
LocalAuthor.class);
// The reference may be null if the activity has been recreated,
// for example due to screen rotation
if(a == null) showButtons();
else storeLocalAuthor(a);
} else if(databaseConfig.getEncryptionKey() == null) {
// The activity was launched from the splash screen
if(System.currentTimeMillis() < EXPIRY_DATE) showPasswordPrompt();