Explorar el Código

cursor: even finer null check on backend (#736)

slight improvement to #736
sschmid hace 5 años
padre
commit
2e566daf64
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.ts

+ 1 - 1
src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.ts

@@ -686,7 +686,7 @@ export class OpenSheetMusicDisplay {
             const previousIterator: MusicPartManagerIterator = this.cursor?.Iterator;
 
             // create new cursor
-            if (this.drawer?.Backends?.length >= 1) {
+            if (this.drawer?.Backends?.length >= 1 && this.drawer.Backends[0].getRenderElement()) {
                 this.cursor = new Cursor(this.drawer.Backends[0].getRenderElement(), this);
             }
             if (this.sheet && this.graphic && this.cursor) { // else init is called in load()