Browse Source

Protect against malformed results

Sebastien Lebreton 5 năm trước cách đây
mục cha
commit
5b986140e6
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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)};
                 });
         }