Update DashOsMoFragment.java

NPE check
This commit is contained in:
vshcherb 2015-06-11 13:49:25 +02:00
parent aedd385e91
commit f971f17b8b

View file

@ -90,7 +90,9 @@ public class DashOsMoFragment extends DashLocationFragment implements OsMoGroups
@Override
public void onDestroy() {
super.onDestroy();
plugin.setGroupsActivity(null);
if (plugin != null) {
plugin.setGroupsActivity(null);
}
}
private void setupOsMoView() {
@ -155,14 +157,14 @@ public class DashOsMoFragment extends DashLocationFragment implements OsMoGroups
private void updateStatus() {
View header = getView();
if (getView() == null) {
if (getView() == null ) {
return;
}
View cardContent = header.findViewById(R.id.card_content);
View enableOsmo = header.findViewById(R.id.header_layout).findViewById(R.id.check_item);
View manage = header.findViewById(R.id.manage);
if (plugin.getService().isEnabled()) {
if (plugin == null || plugin.getService().isEnabled() ) {
cardContent.setVisibility(View.VISIBLE);
enableOsmo.setVisibility(View.GONE);
manage.setVisibility(View.VISIBLE);