summaryrefslogtreecommitdiff
path: root/script/core/rename.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/core/rename.lua')
-rw-r--r--script/core/rename.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script/core/rename.lua b/script/core/rename.lua
index c3325b7e..85cbab52 100644
--- a/script/core/rename.lua
+++ b/script/core/rename.lua
@@ -81,6 +81,9 @@ local function renameField(source, newname, callback)
local uri = guide.getUri(source)
local text = files.getText(uri)
local state = files.getState(uri)
+ if not state or not text then
+ return false
+ end
local func = parent.value
-- function mt:name () end --> mt['newname'] = function (self) end
local startOffset = guide.positionToOffset(state, parent.start) + 1