From 7e1d97665ab6d769241b9038d05c2b7bfeef7bd9 Mon Sep 17 00:00:00 2001 From: Nik Date: Tue, 7 Aug 2018 18:03:31 +0200 Subject: [PATCH] fix: only access nested json values when corrent payload type (#3352) --- react/features/subtitles/middleware.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/react/features/subtitles/middleware.js b/react/features/subtitles/middleware.js index 8c4eb8848..8cbf497cc 100644 --- a/react/features/subtitles/middleware.js +++ b/react/features/subtitles/middleware.js @@ -65,6 +65,12 @@ MiddlewareRegistry.register(store => next => action => { * @returns {Object} The value returned by {@code next(action)}. */ function _endpointMessageReceived({ dispatch, getState }, next, action) { + if (!(action.json + && (action.json.type === JSON_TYPE_TRANSCRIPTION_RESULT + || action.json.type === JSON_TYPE_TRANSLATION_RESULT))) { + return next(action); + } + const json = action.json; const translationLanguage = getState()['features/base/conference'].conference