Skip to content

Commit 9b01e5a

Browse files
committed
fix bug: crash on opening subtitles
1 parent 575859c commit 9b01e5a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/xbmcswift2/xbmcmixin.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,13 @@ def _add_subtitles(self, subtitles):
312312
# this method.
313313
player = xbmc.Player()
314314
monitor = xbmc.Monitor()
315-
for _ in range(30) and not monitor.abortRequested():
315+
for _ in range(30):
316316
if player.isPlaying():
317317
break
318+
319+
if monitor.abortRequested():
320+
return
321+
318322
monitor.waitForAbort(1)
319323
else:
320324
raise Exception('No video playing. Aborted after 30 seconds.')

0 commit comments

Comments
 (0)