🚑 Hot fix for text editor internal error

This commit is contained in:
Aitor Moreno
2026-02-10 10:35:24 +01:00
committed by Belén Albeza
parent c4aa51bc01
commit e9b2e9e818

View File

@@ -702,7 +702,8 @@ export function isEmpty(instance) {
if (isTextEditor(instance)) {
return instance.isEmpty;
}
throw new TypeError('Instance is not a TextEditor');
return null;
// throw new TypeError('Instance is not a TextEditor');
}
/**
@@ -716,7 +717,8 @@ export function getRoot(instance) {
if (isTextEditor(instance)) {
return instance.root;
}
throw new TypeError("Instance is not a TextEditor");
return null;
// throw new TypeError("Instance is not a TextEditor");
}
/**
@@ -729,9 +731,10 @@ export function getRoot(instance) {
export function setRoot(instance, root) {
if (isTextEditor(instance)) {
instance.root = root;
return instance;
// return instance;
}
throw new TypeError("Instance is not a TextEditor");
return instance;
// throw new TypeError("Instance is not a TextEditor");
}
/**
@@ -756,7 +759,8 @@ export function getCurrentStyle(instance) {
if (isTextEditor(instance)) {
return instance.currentStyle;
}
throw new TypeError("Instance is not a TextEditor");
// throw new TypeError("Instance is not a TextEditor");
return null;
}
/**
@@ -771,7 +775,8 @@ export function applyStylesToSelection(instance, styles) {
if (isTextEditor(instance)) {
return instance.applyStylesToSelection(styles);
}
throw new TypeError("Instance is not a TextEditor");
// throw new TypeError("Instance is not a TextEditor");
return null;
}
/**
@@ -785,7 +790,8 @@ export function dispose(instance) {
if (isTextEditor(instance)) {
return instance.dispose();
}
throw new TypeError("Instance is not a TextEditor");
// throw new TypeError("Instance is not a TextEditor");
return null;
}
export default TextEditor;