Skip to content

Commit 04ea002

Browse files
authored
Fix: only fire event when instance is available (issue 17847) (#17987)
* only fire event when instance is available * avoid js issue when no markup
1 parent ed0b236 commit 04ea002

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
toolbar: editorConfig.toolbar,
257257
model: vm.model,
258258
getValue: function () {
259-
return vm.model.value.markup;
259+
return vm.model.value.markup ?? "";
260260
},
261261
setValue: function (newVal) {
262262
vm.model.value.markup = newVal;
@@ -348,7 +348,9 @@
348348
// But I'm not sure it's needed, as this does not trigger the RTE
349349
if(modelObject) {
350350
modelObject.update(vm.model.value.blocks, $scope);
351-
vm.tinyMceEditor.fire('updateBlocks');
351+
if (vm.tinyMceEditor) {
352+
vm.tinyMceEditor.fire('updateBlocks');
353+
}
352354
onLoaded();
353355
}
354356
}

0 commit comments

Comments
 (0)