Browse Source

adapted undefined check.

Matthias Uiberacker 7 years ago
parent
commit
fb3e0745e3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

+ 1 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

@@ -144,7 +144,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
     // Stem direction calculation:
     if (graphicalNotes.length > 0) {
       const firstNote: GraphicalNote = graphicalNotes[0];
-      if (firstNote !== undefined) {
+      if (firstNote.sourceNote.ParentVoiceEntry !== undefined) {
         const hasLink: boolean = graphicalStaffEntry.sourceStaffEntry.Link !== undefined;
         if (hasLink) {
           // in case of StaffEntryLink don't check mainVoice / linkedVoice