Parcourir la source

Protect against malformed results

Sebastien Lebreton il y a 5 ans
Parent
commit
5b986140e6
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      Playground/js/monacoCreator.js

+ 3 - 0
Playground/js/monacoCreator.js

@@ -82,6 +82,9 @@ class MonacoCreator {
             return hooked
                 .apply(this, [model, position, context, token])
                 .then(result => {
+                    if (!result.suggestions)
+                        return result;
+
                     return { suggestions: result.suggestions.filter(suggestionFilter)};
                 });
         }