aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-08-19 17:32:41 -0700
committerScott Jackson <daneren2005@gmail.com>2015-08-19 17:32:41 -0700
commit0fdcde2c7cd2886454b8721fb9d50bae03dca9fe (patch)
treedd7f09b3e23b4dd863c6ce615fa128c520055bc0 /app
parentc4965ade2f1917cb4aa9a97007b0fc306e48e7dd (diff)
downloaddsub-0fdcde2c7cd2886454b8721fb9d50bae03dca9fe.tar.gz
dsub-0fdcde2c7cd2886454b8721fb9d50bae03dca9fe.tar.bz2
dsub-0fdcde2c7cd2886454b8721fb9d50bae03dca9fe.zip
Fix crash when removing podcast episodes (probably others)
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java b/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java
index 3bb3e8a1..2d7f4c44 100644
--- a/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java
+++ b/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java
@@ -32,6 +32,10 @@ public class GridSpacingDecoration extends RecyclerView.ItemDecoration {
int childCount = parent.getChildCount();
int childIndex = parent.getChildPosition(view);
+ // Not an actual child (ie: during delete event)
+ if(childIndex == -1) {
+ return;
+ }
int spanCount = getTotalSpan(view, parent);
int spanIndex = childIndex % spanCount;
int spanSize = getSpanSize(parent, childIndex);