diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-08-19 17:32:41 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-08-19 17:32:41 -0700 |
commit | 0fdcde2c7cd2886454b8721fb9d50bae03dca9fe (patch) | |
tree | dd7f09b3e23b4dd863c6ce615fa128c520055bc0 /app | |
parent | c4965ade2f1917cb4aa9a97007b0fc306e48e7dd (diff) | |
download | dsub-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.java | 4 |
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); |