diff --git a/xbmc/AutoSwitch.cpp b/xbmc/AutoSwitch.cpp index cd12746a311e9..efe7cf4426af3 100644 --- a/xbmc/AutoSwitch.cpp +++ b/xbmc/AutoSwitch.cpp @@ -238,5 +238,5 @@ float CAutoSwitch::MetadataPercentage(const CFileItemList &vecItems) if(item->IsParentFolder()) total--; } - return (float)count / total; + return (total != 0) ? ((float)count / total) : 0; }