From 532d507aa04c2f220ae63d118898a39ab18d13c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 2 Feb 2021 22:22:12 +0800 Subject: fix errors --- script/service/service.lua | 1 + script/vm/getGlobals.lua | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/script/service/service.lua b/script/service/service.lua index 450440a6..8f76a294 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -11,6 +11,7 @@ local ws = require 'workspace' local m = {} m.type = 'service' +m.idleClock = 0.0 local function countMemory() local mems = {} diff --git a/script/vm/getGlobals.lua b/script/vm/getGlobals.lua index 842db4c3..0c502ecd 100644 --- a/script/vm/getGlobals.lua +++ b/script/vm/getGlobals.lua @@ -8,6 +8,9 @@ local config = require 'config' local ws = require 'workspace' local function getGlobalsOfFile(uri) + if not files.exists(uri) then + return {} + end local cache = files.getCache(uri) if cache.globals then return cache.globals @@ -47,6 +50,9 @@ local function getGlobalsOfFile(uri) end local function getGlobalSetsOfFile(uri) + if not files.exists(uri) then + return {} + end local cache = files.getCache(uri) if cache.globalSets then return cache.globalSets -- cgit v1.2.3