From 4190a3e8ebd0ff1408fc47927394970de952f18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 29 Jul 2022 02:27:13 +0800 Subject: fix runtime errors reported by telemetry --- script/workspace/require-path.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'script/workspace/require-path.lua') diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua index 204a22a6..8048f8ef 100644 --- a/script/workspace/require-path.lua +++ b/script/workspace/require-path.lua @@ -169,9 +169,9 @@ function mt:findUrisByRequireName(suri, name) local searcherMap = {} for _, searcher in ipairs(searchers) do - local fspath = searcher:gsub('%?', path) - if self.scp.uri then - local fullPath = workspace.getAbsolutePath(self.scp.uri, fspath) + local fspath = searcher:gsub('%?', path:gsub('%%', '%%%%')) + local fullPath = workspace.getAbsolutePath(self.scp.uri, fspath) + if fullPath then local fullUri = furi.encode(fullPath) if files.exists(fullUri) and fullUri ~= suri then -- cgit v1.2.3