refs #416 Skip stop streaming if the object is not initialized

This commit is contained in:
AkiraFukushima 2018-07-01 21:15:54 +09:00
parent 8cdfcaa5a1
commit 1c4a06ef92
1 changed files with 12 additions and 6 deletions

View File

@ -476,8 +476,10 @@ ipcMain.on('start-local-streaming', (event, ac) => {
})
ipcMain.on('stop-local-streaming', (event, _) => {
localStreaming.stop()
localStreaming = null
if (localStreaming !== null) {
localStreaming.stop()
localStreaming = null
}
})
let publicStreaming = null
@ -511,8 +513,10 @@ ipcMain.on('start-public-streaming', (event, ac) => {
})
ipcMain.on('stop-public-streaming', (event, _) => {
publicStreaming.stop()
publicStreaming = null
if (publicStreaming !== null) {
publicStreaming.stop()
publicStreaming = null
}
})
let listStreaming = null
@ -583,8 +587,10 @@ ipcMain.on('start-tag-streaming', (event, obj) => {
})
ipcMain.on('stop-tag-streaming', (event, _) => {
tagStreaming.stop()
tagStreaming = null
if (tagStreaming !== null) {
tagStreaming.stop()
tagStreaming = null
}
})
// sounds