Skip to content

Commit eddbfdf

Browse files
committed
Check if source settings has input
Fixes #54
1 parent e0e0491 commit eddbfdf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/components/Chat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,9 @@ class Chat {
630630
} = yield _this6.obs.send("GetSourceSettings", {
631631
sourceName: e.sourceName
632632
});
633+
var input = sourceSettings === null || sourceSettings === void 0 ? void 0 : sourceSettings.input.toLowerCase();
633634

634-
if (sourceSettings.input.includes("rtmp") || sourceSettings.input.includes("srt")) {
635+
if (input !== null && input !== void 0 && input.startsWith("rtmp") || input !== null && input !== void 0 && input.startWith("srt")) {
635636
yield _this6.obs.send("RestartMedia", {
636637
sourceName: e.sourceName
637638
});

src/components/Chat.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,9 @@ class Chat {
646646
sourceName: e.sourceName
647647
});
648648

649-
if (sourceSettings.input.includes("rtmp") ||
650-
sourceSettings.input.includes("srt")
651-
) {
649+
const input = sourceSettings.input?.toLowerCase();
650+
651+
if (input?.startsWith("rtmp") || input?.startWith("srt")) {
652652
await this.obs.send("RestartMedia", {
653653
sourceName: e.sourceName
654654
});

0 commit comments

Comments
 (0)