Skip to content

Commit 65c43ae

Browse files
committed
Check if publish isn't null
Fixes #55
1 parent 5adc4e1 commit 65c43ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/components/ObsSwitcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class ObsSwitcher extends _events.default {
150150
var publish = result.rtmp.server[0].application.find(stream => {
151151
return stream.name[0] === application;
152152
}).live[0].stream;
153-
var stream = publish.find(stream => {
153+
var stream = publish === null || publish === void 0 ? void 0 : publish.find(stream => {
154154
return stream.name[0] === key;
155155
});
156156

src/components/ObsSwitcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class ObsSwitcher extends EventEmitter {
210210
}
211211
).live[0].stream;
212212

213-
const stream = publish.find((stream) => {
213+
const stream = publish?.find((stream) => {
214214
return stream.name[0] === key;
215215
});
216216

0 commit comments

Comments
 (0)