add break

This commit is contained in:
suchmememanyskill
2021-07-10 14:45:09 +02:00
parent 91af9b4437
commit 0bef41c033
5 changed files with 28 additions and 6 deletions

View File

@@ -113,8 +113,14 @@ ClassFunction(arrayForEach) {
iter->gcDoNotFree = 1;
Variable_t* res = genericCallDirect(args[1], NULL, 0);
if (res == NULL)
return NULL;
if (res == NULL) {
if (scriptLastError == SCRIPT_BREAK) {
break;
}
else {
return NULL;
}
}
}
iter->reference = 1;