From 3d6f0c7d9f260734f2166e7e4f719227b08b060d Mon Sep 17 00:00:00 2001 From: McAuley Penney Date: Sun, 12 Jun 2022 08:21:21 -0700 Subject: [PATCH] fix: check for opts tbl in is_excluded_ft MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • problem: attempt to index a nil value err solution: check for opts table before attempting to check if opts table contains anything else Should be considered a temporary fix. Validating the incoming options table should be its own functionality --- lua/tidy/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/tidy/init.lua b/lua/tidy/init.lua index 23a317d..b31c17b 100644 --- a/lua/tidy/init.lua +++ b/lua/tidy/init.lua @@ -1,7 +1,7 @@ local M = {} local function is_excluded_ft(opts) - if not opts.filetype_exclude then + if not opts or not opts.filetype_exclude then return false end