diff options
author | Markus Härer <markus.haerer@gmx.net> | 2016-07-02 17:45:29 +0200 |
---|---|---|
committer | Markus Härer <markus.haerer@gmx.net> | 2016-07-16 23:34:00 +0200 |
commit | ffaa30649479d97d08d5c5d03f326479b135e704 (patch) | |
tree | 935dbac0cdd15fac5d1c94410df3c54117d56f18 | |
parent | 1183ba3fd5c7db70cbc944189d206df262ad2253 (diff) |
[fix] Fixed possible division by zero
-rw-r--r-- | xbmc/AutoSwitch.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xbmc/AutoSwitch.cpp b/xbmc/AutoSwitch.cpp index cd12746a31..e2bb56c590 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.0f; } |