Skip to content

Commit b8138db

Browse files
author
blank_name
committed
Handle nil duration in get_thumbnail_count.
1 parent 2549fb6 commit b8138db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/thumbnailer_shared.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ end
205205

206206

207207
function Thumbnailer:get_thumbnail_count(delta)
208-
if delta == nil then
208+
local file_duration = mp.get_property_native("duration")
209+
if delta == nil or file_duration == nil then
209210
return 0
210211
end
211-
local file_duration = mp.get_property_native("duration")
212212

213213
return math.ceil(file_duration / delta)
214214
end

0 commit comments

Comments
 (0)