Skip to content

Commit 3ac471b

Browse files
authored
fix(snippets): fix nullpointer exception (#355)
1 parent 285f6f4 commit 3ac471b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/blink/cmp/sources/snippets/init.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
local snippets = {}
1010

1111
function snippets.new(opts)
12+
opts = opts or {}
1213
local self = setmetatable({}, { __index = snippets })
1314
--- @type table<string, blink.cmp.CompletionItem[]>
1415
self.cache = {}
1516
--- @type blink.cmp.SnippetsOpts
16-
self.registry = require('blink.cmp.sources.snippets.registry').new(opts or {})
17+
self.registry = require('blink.cmp.sources.snippets.registry').new(opts)
1718
self.get_filetype = opts.get_filetype or function() return vim.bo.filetype end
1819
return self
1920
end

0 commit comments

Comments
 (0)