Skip to content

Commit 344d49d

Browse files
committed
修复:#84 找不到.luacompleterc时返回undefined导致异常
1 parent 505b1bd commit 344d49d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server/preload.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ function loadAll(coder) {
4141

4242
// TODO: add watcher for the modification of the rc file to avoid reload vscode.
4343
findup(".luacompleterc", {cwd: coder.workspaceRoot}).then(rcFilePath => {
44-
coder.tracer.info('loading luacomplete resource file: ' + rcFilePath);
45-
engine.loadExtentLib(rcFilePath, undefined, coder.tracer);
44+
if (rcFilePath !== undefined && typeof(rcFilePath) === 'string') {
45+
coder.tracer.info('loading luacomplete resource file: ' + rcFilePath);
46+
engine.loadExtentLib(rcFilePath, undefined, coder.tracer);
47+
}
48+
4649
});
4750
}
4851

0 commit comments

Comments
 (0)