From 8bd26cb601c31c41813678d4140d865ffc8ad183 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Mon, 18 May 2020 14:18:49 +0300 Subject: [PATCH] handle invalid option when handle setOptions action --- src/services/Chromecast/ChromecastTransport.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/services/Chromecast/ChromecastTransport.js b/src/services/Chromecast/ChromecastTransport.js index b990699e1..87ff6d913 100644 --- a/src/services/Chromecast/ChromecastTransport.js +++ b/src/services/Chromecast/ChromecastTransport.js @@ -187,7 +187,15 @@ function ChromecastTransport() { if (action) { switch (action.type) { case 'setOptions': { - cast.framework.CastContext.getInstance().setOptions(action.options); + try { + cast.framework.CastContext.getInstance().setOptions(action.options); + } catch (error) { + events.emit('error', { + ...CAST_ERROR.INVALID_OPTIONS, + error + }); + } + return; } case 'requestSession': {