Skip to content

Commit 3e136a0

Browse files
Kiriesshkaluisbocanegra
authored andcommitted
fix: prevent JSON parsing error on empty configuration
1 parent 9d5c090 commit 3e136a0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

package/contents/ui/code/utils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
function parseCompat(cfgStr) {
22
let videos = [];
3+
if (!cfgStr || cfgStr.trim() === "" || cfgStr === "[]") {
4+
return videos;
5+
}
36
try {
47
JSON.parse(cfgStr).forEach((video) => {
58
video.playbackRate = video.playbackRate ?? 0.0;

0 commit comments

Comments
 (0)