aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2021-12-02 16:08:51 -0400
committerjgmdev <jgmdev@gmail.com>2021-12-02 16:08:51 -0400
commit7a8cc04b031c4114fa7e85aacea27d21b2f0b331 (patch)
tree734d24db8d2f920bdbfe9fa81dfdcc775231ca34 /plugins
parentc578cf8cf30b07bd21d60f0ab6bc0698a1007a45 (diff)
downloadlite-xl-plugins-7a8cc04b031c4114fa7e85aacea27d21b2f0b331.tar.gz
lite-xl-plugins-7a8cc04b031c4114fa7e85aacea27d21b2f0b331.zip
Plugin open_ext: fix utf8 validation on empty file.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/open_ext.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/open_ext.lua b/plugins/open_ext.lua
index 0c7eff1..8a98516 100644
--- a/plugins/open_ext.lua
+++ b/plugins/open_ext.lua
@@ -143,7 +143,7 @@ local function validate_doc(doc)
if not f then return true end
local str = f:read(128 * 4) -- max bytes for 128 codepoints
f:close()
- return validate_utf8(str, 128)
+ return validate_utf8(str or "", 128)
end