Fix undefined error for Turtle update
Even though the error occurs not very frequent, we want to resolve it. Sentry identified that the former error still occurs and we try once more to fix it. Fixes CODEOCEAN-JH
This commit is contained in:
@ -91,6 +91,12 @@ Turtle.prototype.update = function () {
|
||||
const dx = canvas.width / (2 * devicePixelRatio);
|
||||
const dy = canvas.height / (2 * devicePixelRatio);
|
||||
for (let item of this.items) {
|
||||
// This should not happen, but it does for some unknown reason.
|
||||
// Therefore, we just check for the potential error and break.
|
||||
if (item === undefined || item === null) {
|
||||
break;
|
||||
}
|
||||
|
||||
c = item.coords;
|
||||
switch (item.type) {
|
||||
case 'line':
|
||||
|
Reference in New Issue
Block a user