FIX: Clear theme editor content on switching tabs

Issue happens when sending a null value to ACE Editor.
Fixed by sending an empty string to ACE instead of null.
This commit is contained in:
Penar Musaraj 2019-07-08 20:06:41 -04:00
parent 324e182842
commit f4dc6de9f1
1 changed files with 3 additions and 2 deletions

View File

@ -17,8 +17,9 @@ export default Ember.Component.extend({
@observes("content")
contentChanged() {
if (this._editor && !this._skipContentChangeEvent && this.content) {
this._editor.getSession().setValue(this.content);
const content = this.content || "";
if (this._editor && !this._skipContentChangeEvent) {
this._editor.getSession().setValue(content);
}
},