aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-01-16 13:00:07 -0800
committerScott Jackson <daneren2005@gmail.com>2015-01-16 13:00:07 -0800
commit02e0f441bb908fe65d9a8849e1abf768a0b722dc (patch)
tree0d392b519812eb6558e3d398d7ec0e4ba31ff6ed /src
parent57bf3d8e5c01d5deffa7b65584d5c3132ef2a7c5 (diff)
downloaddsub-02e0f441bb908fe65d9a8849e1abf768a0b722dc.tar.gz
dsub-02e0f441bb908fe65d9a8849e1abf768a0b722dc.tar.bz2
dsub-02e0f441bb908fe65d9a8849e1abf768a0b722dc.zip
Fix crash due to context menu being called for entry list on behalf of header gridview
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index 78c1a773..805c0de0 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -334,12 +334,20 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
return;
}
entry = (Entry) entryList.getItemAtPosition(info.position);
- albumContext = false;
+ // When List has Grid embedded in header, this is called against the header as well
+ if(entry != null) {
+ albumContext = false;
+ }
} else {
entry = (Entry) albumList.getItemAtPosition(info.position);
albumContext = true;
}
+ // Don't try to display a context menu if error here
+ if(entry == null) {
+ return;
+ }
+
onCreateContextMenu(menu, view, menuInfo, entry);
if(!entry.isVideo() && !Util.isOffline(context) && (playlistId == null || !playlistOwner) && (podcastId == null || Util.isOffline(context) && podcastId != null)) {
menu.removeItem(R.id.song_menu_remove_playlist);