Skip to content

857: bad argument #1 to 'max' (number expected, got nil) #24

@Tatsh

Description

@Tatsh

Description of the bug

Sometimes I get this error:

[mpv_thumbnail_script_client_osc]
[mpv_thumbnail_script_client_osc] stack traceback:
[mpv_thumbnail_script_client_osc]       [string "/etc/mpv/scripts/mpv_thumbnail_script_client_..."]:857: in function 'on_thumb_progress'
[mpv_thumbnail_script_client_osc]       [string "/etc/mpv/scripts/mpv_thumbnail_script_client_..."]:1061: in function 'handler'
[mpv_thumbnail_script_client_osc]       mp.defaults:380: in function 'handler'
[mpv_thumbnail_script_client_osc]       mp.defaults:510: in function 'call_event_handlers'
[mpv_thumbnail_script_client_osc]       mp.defaults:555: in function 'dispatch_events'
[mpv_thumbnail_script_client_osc]       mp.defaults:503: in function <mp.defaults:502>
[mpv_thumbnail_script_client_osc]       [C]: at 0x5577b85ca4b0
[mpv_thumbnail_script_client_osc]       [C]: at 0x5577b85cb000
[mpv_thumbnail_script_client_osc] Lua error: [string "/etc/mpv/scripts/mpv_thumbnail_script_client_..."]:857: bad argument #1 to 'max' (number expected, got nil)

That line is here.

It may only be caused when going through a playlist of videos. Could you fallback to 0 if self.state.thumbnails[index] gives nil?

To Reproduce
Steps to reproduce the behavior:

  1. Run playlist and skip videos with enter
  2. See error

Expected behavior

Should not error.

Debug log
None yet.

Log

Environment

  • OS: Linux
  • mpv version: 0.34.1
  • mpv_thumbnail_script version: 0.4.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions