Skip to content

Commit 1b67e22

Browse files
author
blank_name
committed
Ensure that thumbnail files exist before trying to add them to the overlay.
1 parent 66f87ac commit 1b67e22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/patched_osc.lua

+9
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,15 @@ function display_thumbnail(pos, value, ass)
260260
end
261261

262262
if thumb_path then
263+
-- Ensure the thumbnail exists before trying to add it to the
264+
-- overlay.
265+
local thumb = io.open(thumb_path, 'r')
266+
if thumb == nil then
267+
return
268+
else
269+
io.close(thumb)
270+
end
271+
263272
local overlay_y_offset = get_thumbnail_y_offset(thumb_size, msy)
264273

265274
local thumb_x = math.floor(pos.x / msx - thumb_size.w/2)

0 commit comments

Comments
 (0)