Add check for platforms

This commit is contained in:
DariusIII
2018-09-17 15:06:17 +02:00
parent 1e8b354b86
commit dd6729f7f6
+8 -6
View File
@@ -852,12 +852,14 @@ class Console
$platform = '';
foreach ($game->platforms as $platforms) {
$platforms = IGDB::getPlatform($platforms);
similar_text($platforms->name, $gamePlatform, $percent);
if ($percent >= 85) {
$platform = $platforms->name;
break;
if (! empty($game->platforms)) {
foreach ($game->platforms as $platforms) {
$platforms = IGDB::getPlatform($platforms);
similar_text($platforms->name, $gamePlatform, $percent);
if ($percent >= 85) {
$platform = $platforms->name;
break;
}
}
}