aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorronie <ronie@users.noreply.github.com>2018-02-28 13:11:41 +0100
committerronie <ronie@users.noreply.github.com>2018-02-28 13:11:41 +0100
commit7df84b1aba86b5c3ff0f6eced3455bdf9ecc7ad3 (patch)
tree1307122fc496b1c26a790d000fb7a49b9fecd817
parentdd3caa3018bc13002181d118ed2bff4973528fe2 (diff)
prevent crash when retrieving rating
-rw-r--r--xbmc/GUIInfoManager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index aa2f0d0e68..f4a3524e73 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -9497,19 +9497,19 @@ std::string CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::
return item->GetArt(art);
}
- if (info >= LISTITEM_PROPERTY_START + LISTITEM_RATING_OFFSET && info - (LISTITEM_PROPERTY_START + LISTITEM_RATING_OFFSET) < (int)m_listitemProperties.size())
+ if (info >= LISTITEM_PROPERTY_START + LISTITEM_RATING_OFFSET && info - (LISTITEM_PROPERTY_START + LISTITEM_RATING_OFFSET) < (int)m_listitemProperties.size() && item->HasVideoInfoTag())
{ // grab the rating
std::string rating = m_listitemProperties[info - (LISTITEM_PROPERTY_START + LISTITEM_RATING_OFFSET)];
return StringUtils::FormatNumber(item->GetVideoInfoTag()->GetRating(rating).rating);
}
- if (info >= LISTITEM_PROPERTY_START + LISTITEM_VOTES_OFFSET && info - (LISTITEM_PROPERTY_START + LISTITEM_VOTES_OFFSET) < (int)m_listitemProperties.size())
+ if (info >= LISTITEM_PROPERTY_START + LISTITEM_VOTES_OFFSET && info - (LISTITEM_PROPERTY_START + LISTITEM_VOTES_OFFSET) < (int)m_listitemProperties.size() && item->HasVideoInfoTag())
{ // grab the votes
std::string votes = m_listitemProperties[info - (LISTITEM_PROPERTY_START + LISTITEM_VOTES_OFFSET)];
return StringUtils::FormatNumber(item->GetVideoInfoTag()->GetRating(votes).votes);
}
- if (info >= LISTITEM_PROPERTY_START + LISTITEM_RATING_AND_VOTES_OFFSET && info - (LISTITEM_PROPERTY_START + LISTITEM_RATING_AND_VOTES_OFFSET) < (int)m_listitemProperties.size())
+ if (info >= LISTITEM_PROPERTY_START + LISTITEM_RATING_AND_VOTES_OFFSET && info - (LISTITEM_PROPERTY_START + LISTITEM_RATING_AND_VOTES_OFFSET) < (int)m_listitemProperties.size() && item->HasVideoInfoTag())
{ // grab the rating and the votes
std::string ratingName = m_listitemProperties[info - (LISTITEM_PROPERTY_START + LISTITEM_RATING_AND_VOTES_OFFSET)];
CRating rating = item->GetVideoInfoTag()->GetRating(ratingName);