aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Marshall <jmarshall@never.you.mind>2012-12-01 20:06:28 +1300
committerJonathan Marshall <jmarshall@never.you.mind>2012-12-01 20:06:28 +1300
commitc81334142cdd64b7d5b1db7e6336588d472452d7 (patch)
tree6fea993ae3c563432b7af997e3e5bff52026103e
parentda709d53ef5e46d0b18c56f9b2dda0fde3330299 (diff)
[projectM] don't crash 'n burn if no presets are present
-rw-r--r--xbmc/visualizations/XBMCProjectM/Main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/xbmc/visualizations/XBMCProjectM/Main.cpp b/xbmc/visualizations/XBMCProjectM/Main.cpp
index 767aeba961..50492d88ae 100644
--- a/xbmc/visualizations/XBMCProjectM/Main.cpp
+++ b/xbmc/visualizations/XBMCProjectM/Main.cpp
@@ -363,7 +363,8 @@ bool InitProjectM()
else
{
//If it is the first run or a newly chosen preset pack we choose a random preset as first
- globalPM->selectPreset((rand() % (globalPM->getPlaylistSize())));
+ if (globalPM->getPlaylistSize())
+ globalPM->selectPreset((rand() % (globalPM->getPlaylistSize())));
}
return true;
}