Fixed crashes due to Backend not being set before permissions are granted

This commit is contained in:
2020-09-29 19:21:03 -05:00
parent 8fe3035a0d
commit 81bd3e6b2f
2 changed files with 7 additions and 6 deletions

View File

@@ -45,10 +45,10 @@ public class MainActivity extends AppCompatActivity {
if (Backend.instance() == null) { if (Backend.instance() == null) {
new Backend(); new Backend();
} }
}
Backend.instance().applicationContext = getApplicationContext(); Backend.instance().applicationContext = getApplicationContext();
} }
}
@Override @Override
public boolean onSupportNavigateUp() { public boolean onSupportNavigateUp() {

View File

@@ -60,12 +60,13 @@ public class GroupsFragment extends TimeCraftersFragment {
}); });
floatingActionButtonAutoHide(actionButton, scrollView); floatingActionButtonAutoHide(actionButton, scrollView);
if (Backend.instance() != null) {
if (Backend.instance().getConfig() == null) { if (Backend.instance().getConfig() == null) {
actionButton.hide(); actionButton.hide();
} }
if (Backend.instance() != null)
this.config = Backend.instance().getConfig(); this.config = Backend.instance().getConfig();
}
if (config != null) { if (config != null) {
configName.setVisibility(View.GONE); configName.setVisibility(View.GONE);