mirror of
https://github.com/mpv-player/mpv
synced 2024-12-17 20:34:58 +00:00
defaults.js: fix the opened event with mp.input.get
The opened event doesn't send any arguments. Don't call
JSON.parse(undefined) in that case because it errors.
Fixes eb4c6be630
, fixes #15301.
This commit is contained in:
parent
c60d8523ed
commit
ea6b1119d3
@ -653,7 +653,7 @@ mp.options = { read_options: read_options };
|
|||||||
function register_event_handler(t) {
|
function register_event_handler(t) {
|
||||||
mp.register_script_message("input-event", function (type, args) {
|
mp.register_script_message("input-event", function (type, args) {
|
||||||
if (t[type]) {
|
if (t[type]) {
|
||||||
args = JSON.parse(args)
|
args = args ? JSON.parse(args) : [];
|
||||||
var result = t[type](args[0], args[1]);
|
var result = t[type](args[0], args[1]);
|
||||||
|
|
||||||
if (type == "complete" && result) {
|
if (type == "complete" && result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user