瀏覽代碼

Protect against malformed results

Sebastien Lebreton 5 年之前
父節點
當前提交
5b986140e6
共有 1 個文件被更改,包括 3 次插入0 次删除
  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)};
                 });
         }