Prevent crash reported on Google Play (Null Pointer Exception in OnLoaderReset)

This commit is contained in:
Synced Synapse 2015-03-23 22:34:24 +00:00
parent de9ddc3957
commit 438442cb37
1 changed files with 7 additions and 1 deletions

View File

@ -53,6 +53,7 @@ import org.xbmc.kore.provider.MediaContract;
import org.xbmc.kore.service.LibrarySyncService;
import org.xbmc.kore.utils.LogUtils;
import org.xbmc.kore.utils.UIUtils;
import org.xbmc.kore.utils.Utils;
import butterknife.ButterKnife;
import butterknife.InjectView;
@ -372,7 +373,12 @@ public class TVShowEpisodeListFragment extends Fragment
// Check if the group cursor is set before setting the children cursor
// Somehow, when poping the back stack, the children cursor are reloaded first...
if (adapter.getCursor() != null) {
adapter.setChildrenCursor(cursorLoader.getId(), null);
try {
adapter.setChildrenCursor(cursorLoader.getId(), null);
} catch (NullPointerException exc) {
// Errrr... Adapter expired?
LogUtils.LOGW(TAG, "Adapter expired.");
}
}
break;
}