-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪲 Remove a source of client exceptions (#5812)
A lot of client exceptions were originating from the embedded editor, trying to call `removeAttribute()` on an object that happened to be `null`. The reason was an assertion that the result of `getElementById()` would never be `null`, where in fact, it was. Replace with a null coalescing function call `?.removeAttribute()` so that the function call falls to the floor if the element doesn't exist. **How to test** Visit http://localhost:8080/embedded/1/?lang=nl&run=true&readOnly=false&fullWidth=false&program=IyBTY2hyaWpmIGpvdXcgY29kZSBoaWVy%22 and run any program. Observe that no exceptions get logged to the JavaScript console. (cc @jpelay, I spied you [here](#5673) 😛 this is why `!` is dangerous, even you *think* this can never happen there's always a case you didn't think of -- better to program defensively or fail real hard with an explicit error message)
- Loading branch information
Showing
3 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters