mirror of
https://github.com/penpot/penpot.git
synced 2026-02-12 14:42:56 +00:00
🚑 Hot fix for text editor internal error
This commit is contained in:
committed by
Belén Albeza
parent
c4aa51bc01
commit
e9b2e9e818
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user