mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.71k stars 2.84k forks source link

console.lua: fix crash if no completions exist #14247

Closed na-na-hi closed 1 month ago

na-na-hi commented 1 month ago

If complete is case-sensitive and no completions exist the script crashes with the following:

Lua error: @console.lua:1417: attempt to concatenate local 'prefix' (a nil value)

github-actions[bot] commented 1 month ago

Download the artifacts for this pull request:

Windows * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1541110508.zip) * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1541116148.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1541142780.zip)
macOS * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1541108108.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1541109355.zip) * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1541117618.zip)
debugzxcv commented 1 month ago

another crash:

[console] stack traceback:
[console]       mp.defaults:231: in function 'fn'
[console]       mp.defaults:66: in function 'handler'
[console]       mp.defaults:383: in function 'handler'
[console]       mp.defaults:513: in function 'call_event_handlers'
[console]       mp.defaults:555: in function 'dispatch_events'
[console]       mp.defaults:506: in function <mp.defaults:505>
[console]       [C]: at 0x7ff7b519fe60
[console]       [C]: at 0x7ff7b519eba0
[console] Lua error: @console.lua:1352: attempt to index local 'first_useful_token' (a nil value)

Reproduction Steps:

  1. type set ;
  2. hit TAB key