From d7ca790d4bbbb650bdbcd81b0ff489fdf3076960 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:10:12 -0500 Subject: [PATCH] Check selectedItem.json.userdata.PlaybackPositionTicks is valid Fixes #1658 --- source/Main.bs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/Main.bs b/source/Main.bs index 2ef81455..af425759 100644 --- a/source/Main.bs +++ b/source/Main.bs @@ -282,7 +282,19 @@ sub Main (args as dynamic) as void end if ' Display playback options dialog - if selectedItem.json.userdata.PlaybackPositionTicks > 0 + showPlaybackOptionDialog = false + + if isValid(selectedItem.json) + if isValid(selectedItem.json.userdata) + if isValid(selectedItem.json.userdata.PlaybackPositionTicks) + if selectedItem.json.userdata.PlaybackPositionTicks > 0 + showPlaybackOptionDialog = true + end if + end if + end if + end if + + if showPlaybackOptionDialog dialog.close = true m.global.queueManager.callFunc("hold", selectedItem) playbackOptionDialog(selectedItem.json.userdata.PlaybackPositionTicks, selectedItem.json)