diff options
author | Trent Nelson <trent.a.b.nelson@gmail.com> | 2014-02-11 11:16:21 -0700 |
---|---|---|
committer | Trent Nelson <trent.a.b.nelson@gmail.com> | 2014-02-11 11:16:21 -0700 |
commit | 8ffac13defac1ecc2cb4ca33a1cee372e87c61ba (patch) | |
tree | 49d6bd53846ef2fb488febf9787715f14ccd4409 | |
parent | e029c3d2b40c4d70a29cea7d5041807190915e1d (diff) | |
parent | 015d3297cb6ee878f8927f4f0e06d5d75c5f51bd (diff) |
Merge pull request #4185 from Montellese/fix_empty_tvshow_crash
videolibrary: fix crash when entering an empty tvshow
-rw-r--r-- | xbmc/video/windows/GUIWindowVideoNav.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xbmc/video/windows/GUIWindowVideoNav.cpp b/xbmc/video/windows/GUIWindowVideoNav.cpp index 37e01d9cf9..60f3ad3519 100644 --- a/xbmc/video/windows/GUIWindowVideoNav.cpp +++ b/xbmc/video/windows/GUIWindowVideoNav.cpp @@ -285,12 +285,12 @@ bool CGUIWindowVideoNav::GetDirectory(const CStdString &strDirectory, CFileItemL VIDEODATABASEDIRECTORY::NODE_TYPE node = dir.GetDirectoryChildType(items.GetPath()); // perform the flattening logic for tvshows with a single (unwatched) season (+ optional special season) - if (node == NODE_TYPE_SEASONS) + if (node == NODE_TYPE_SEASONS && !items.IsEmpty()) { int itemsSize = items.GetObjectCount(); int firstIndex = items.Size() - itemsSize; // check if the last item is the "All seasons" item which should be ignored for flattening - if (items[items.Size() - 1]->GetVideoInfoTag()->m_iSeason < 0) + if (!items[items.Size() - 1]->HasVideoInfoTag() || items[items.Size() - 1]->GetVideoInfoTag()->m_iSeason < 0) itemsSize -= 1; int iFlatten = CSettings::Get().GetInt("videolibrary.flattentvshows"); |