Skip to content

Commit 7f0e9fb

Browse files
mjansenDatabayrfalkenstein
authored andcommitted
[FIX] Test: Fix null as offset and key parameter
1 parent 590c606 commit 7f0e9fb

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

components/ILIAS/TestQuestionPool/classes/class.assErrorText.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ private function completeParsedErrorTextFromErrorData(): void
377377
{
378378
foreach ($this->errordata as $error) {
379379
$position = $error->getPosition();
380+
if ($position === null) {
381+
continue;
382+
}
383+
380384
foreach ($this->getParsedErrorText() as $key => $paragraph) {
381385
if (array_key_exists($position, $paragraph)) {
382386
$this->parsed_errortext[$key][$position]['text_correct'] =
@@ -905,7 +909,11 @@ private function generateArrayByPositionFromErrorData(): array
905909
{
906910
$array_by_position = [];
907911
foreach ($this->errordata as $error) {
908-
$array_by_position[$error->getPosition()] = [
912+
$position = $error->getPosition();
913+
if ($position === null) {
914+
continue;
915+
}
916+
$array_by_position[$position] = [
909917
'length' => $error->getLength(),
910918
'points' => $error->getPoints(),
911919
'text' => $error->getTextWrong(),

0 commit comments

Comments
 (0)