Vanessa 3 anni fa
parent
commit
522d2dc465
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      app/src/util/backForward.ts

+ 1 - 1
app/src/util/backForward.ts

@@ -254,7 +254,7 @@ export const pushBack = (protyle: IProtyle, range?: Range, blockElement?: Elemen
     if (!protyle.model) {
     if (!protyle.model) {
         return;
         return;
     }
     }
-    if (!blockElement) {
+    if (!blockElement && range) {
         blockElement = hasClosestBlock(range.startContainer) as Element;
         blockElement = hasClosestBlock(range.startContainer) as Element;
     }
     }
     if (!blockElement) {
     if (!blockElement) {