Skip to content

Commit 9c00570

Browse files
committed
Possible fix for issue #295
1 parent c30e47c commit 9c00570

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/jquery.contextMenu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@
584584
}
585585
break;
586586
}
587-
if (typeof opt.$selected !== 'undefined') {
587+
if (typeof opt.$selected !== 'undefined' && opt.$selected !== null) {
588588
opt.$selected.trigger('mouseup');
589589
}
590590
return;
@@ -613,7 +613,7 @@
613613
// pass event to selected item,
614614
// stop propagation to avoid endless recursion
615615
e.stopPropagation();
616-
if (typeof opt.$selected !== 'undefined') {
616+
if (typeof opt.$selected !== 'undefined' && opt.$selected !== null) {
617617
opt.$selected.trigger(e);
618618
}
619619
},
@@ -770,7 +770,7 @@
770770
root = data.contextMenuRoot;
771771

772772
if (root !== opt && root.$layer && root.$layer.is(e.relatedTarget)) {
773-
if (typeof root.$selected !== 'undefined') {
773+
if (typeof root.$selected !== 'undefined' && root.$selected !== null) {
774774
root.$selected.trigger('contextmenu:blur');
775775
}
776776
e.preventDefault();

0 commit comments

Comments
 (0)