Skip to content

fix(modernx): avoid nil error when generating comment filename#68

Merged
zydezu merged 1 commit intozydezu:mainfrom
lonerOrz:fix-avoid-splicing-nil
Jun 23, 2025
Merged

fix(modernx): avoid nil error when generating comment filename#68
zydezu merged 1 commit intozydezu:mainfrom
lonerOrz:fix-avoid-splicing-nil

Conversation

@lonerOrz
Copy link
Copy Markdown

@lonerOrz lonerOrz commented Jun 7, 2025

Problem

When playing videos from URLs such as Bilibili, the script modernx.lua attempts to construct a .info.json path using the video filename. However, if mp.get_property("filename") returns nil, or if the result of :match(...) returns nil, the script crashes with the following error:

图片

This happens at line 1751 and interrupts the playback experience, especially when comments are enabled.


@zydezu zydezu merged commit a763b6b into zydezu:main Jun 23, 2025
zydezu added a commit to zydezu/mpvconfig that referenced this pull request Jun 23, 2025
@lonerOrz lonerOrz deleted the fix-avoid-splicing-nil branch June 23, 2025 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants