fix error when next card null

This commit is contained in:
Audrey Jensen 2023-07-19 20:19:03 +00:00
parent b053c7b617
commit be44377631

View File

@ -85,7 +85,7 @@ class SafetyController extends AbstractController
{ {
$nextTopic = $contentFile['Cards'][$arrayKeys[$cardIndex]][$i+1]; $nextTopic = $contentFile['Cards'][$arrayKeys[$cardIndex]][$i+1];
} }
else if($cardIndex < count($contentFile['Cards'])) //Next topic is not in same card, or does not exist else if($cardIndex < count($contentFile['Cards'])-1) //Next topic is not in same card, or does not exist
{ {
$nextTopic = $contentFile['Cards'][$arrayKeys[$cardIndex+1]][0]; //Set to first entry in next card $nextTopic = $contentFile['Cards'][$arrayKeys[$cardIndex+1]][0]; //Set to first entry in next card
} }