Don't throw an exception without turtle canvas

Fixes CODEOCEAN-FRONTEND-59
This commit is contained in:
Sebastian Serth
2023-11-17 14:37:51 +01:00
parent 35a65e4744
commit c18aadaf61

View File

@ -45,7 +45,7 @@ CodeOceanEditorTurtle = {
hideCanvas: function () {
const turtlediv = $('#turtlediv');
if (turtlediv.isPresent() && !turtlediv.hasClass('d-none')) {
if (turtlediv && turtlediv.isPresent() && !turtlediv.hasClass('d-none')) {
turtlediv.addClass('d-none');
}
}