Skip to content

Commit

Permalink
[fix] Fixed possible division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
neo1973 committed Jul 16, 2016
1 parent 10f7839 commit a850e05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/AutoSwitch.cpp
Expand Up @@ -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;
}

0 comments on commit a850e05

Please sign in to comment.