From 2589e6b2eeaf5e82c3caaf1a7fd8c60ed7d2d149 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 7 Oct 2015 09:28:12 -0400 Subject: Fixed potential bug in UPDATE_UI handler; modules/textadept/snippets.lua It's possible for the `updated` parameter to be `nil`; handle it. --- modules/textadept/snippets.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index 2c2bbf15..5c039d12 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -530,7 +530,8 @@ M._snippet_mt = { -- Update snippet transforms when text is added or deleted. events.connect(events.UPDATE_UI, function(updated) - if #snippet_stack > 0 and bit32.band(updated, buffer.UPDATE_CONTENT) > 0 then + if #snippet_stack > 0 and updated and + bit32.band(updated, buffer.UPDATE_CONTENT) > 0 then snippet_stack[#snippet_stack]:update_transforms() end end) -- cgit v1.2.3