Pārlūkot izejas kodu

fix: only access nested json values when corrent payload type (#3352)

master
Nik 7 gadus atpakaļ
vecāks
revīzija
7e1d97665a
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6
    0
      react/features/subtitles/middleware.js

+ 6
- 0
react/features/subtitles/middleware.js Parādīt failu

65
  * @returns {Object} The value returned by {@code next(action)}.
65
  * @returns {Object} The value returned by {@code next(action)}.
66
  */
66
  */
67
 function _endpointMessageReceived({ dispatch, getState }, next, action) {
67
 function _endpointMessageReceived({ dispatch, getState }, next, action) {
68
+    if (!(action.json
69
+        && (action.json.type === JSON_TYPE_TRANSCRIPTION_RESULT
70
+            || action.json.type === JSON_TYPE_TRANSLATION_RESULT))) {
71
+        return next(action);
72
+    }
73
+
68
     const json = action.json;
74
     const json = action.json;
69
     const translationLanguage
75
     const translationLanguage
70
         = getState()['features/base/conference'].conference
76
         = getState()['features/base/conference'].conference

Notiek ielāde…
Atcelt
Saglabāt