From 88a25580390d304099bf1bb16e0bb685130c49f3 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Wed, 11 Nov 2020 17:46:02 +0100 Subject: [PATCH] Check for this.active_frame.data() before accessing --- app/assets/javascripts/editor/editor.js.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index c3e7ad44..fe3fbf56 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -629,10 +629,16 @@ var CodeOceanEditor = { }, isActiveFileBinary: function () { + if (this.active_frame.data() === undefined) { + return false; + } return 'binary' in this.active_frame.data(); }, isActiveFileExecutable: function () { + if (this.active_frame.data() === undefined) { + return false; + } return 'executable' in this.active_frame.data(); },