fix: crash on palette init error
This commit is contained in:
parent
2e0e8fd527
commit
908f2f57fb
2 changed files with 2 additions and 0 deletions
|
|
@ -93,6 +93,7 @@ pub fn Create(options: type) type {
|
|||
.match_count = 0,
|
||||
};
|
||||
try self.commands.init(self);
|
||||
errdefer self.commands.deinit();
|
||||
self.mode.event_handler = EventHandler.to_owned(self);
|
||||
self.mode.name = options.name;
|
||||
if (self.menu.scrollbar) |scrollbar| scrollbar.style_factory = scrollbar_style;
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ pub fn Create(options: type) type {
|
|||
.placement = if (@hasDecl(options, "placement")) options.placement else .top_center,
|
||||
};
|
||||
try self.commands.init(self);
|
||||
errdefer self.commands.deinit();
|
||||
self.mode.event_handler = EventHandler.to_owned(self);
|
||||
self.mode.name = options.name;
|
||||
if (self.menu.scrollbar) |scrollbar| scrollbar.style_factory = scrollbar_style;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue