From 4ea998c3af8548ecb8ccba160894c5a37603b653 Mon Sep 17 00:00:00 2001 From: Amilcar Andrade Date: Thu, 14 Apr 2016 12:46:26 -0400 Subject: [PATCH] Prevent PlayerActivity from crashing --- app/src/main/java/io/plaidapp/ui/PlayerActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/plaidapp/ui/PlayerActivity.java b/app/src/main/java/io/plaidapp/ui/PlayerActivity.java index ecacdf21a..8d6ca29eb 100644 --- a/app/src/main/java/io/plaidapp/ui/PlayerActivity.java +++ b/app/src/main/java/io/plaidapp/ui/PlayerActivity.java @@ -46,7 +46,6 @@ import butterknife.ButterKnife; import butterknife.OnClick; import io.plaidapp.R; -import io.plaidapp.data.PlaidItem; import io.plaidapp.data.api.dribbble.PlayerShotsDataManager; import io.plaidapp.data.api.dribbble.model.Shot; import io.plaidapp.data.api.dribbble.model.User; @@ -154,11 +153,17 @@ protected void onPause() { @Override protected void onDestroy() { - dataManager.cancelLoading(); + if (dataManager != null) { + dataManager.cancelLoading(); + } super.onDestroy(); } private void bindPlayer() { + if (player == null) { + return; + } + final Resources res = getResources(); final NumberFormat nf = NumberFormat.getInstance();