From 26e2a16f98a172f3d8586478fb8ba9b24450ca7b Mon Sep 17 00:00:00 2001 From: KGT1 Date: Wed, 30 Sep 2020 17:37:26 +0200 Subject: [PATCH] add error check --- src/interactivemsghandler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interactivemsghandler.js b/src/interactivemsghandler.js index daf14b4..b86f886 100644 --- a/src/interactivemsghandler.js +++ b/src/interactivemsghandler.js @@ -44,7 +44,11 @@ function startUpate (callback) { } function updateCurrentSongMessage (title, artist, imageURL, itemURL, ticksLength, playlistIndex, playlistLenth) { - iapm.updateCurrentSongMessage(title, artist, imageURL, itemURL, ticksLength, playlistIndex, playlistLenth); + if (typeof iapm !== "undefined") { + iapm.updateCurrentSongMessage(title, artist, imageURL, itemURL, ticksLength, playlistIndex, playlistLenth); + } else { + throw Error("No Interactive Message Found"); + } } module.exports = {