🔴 Minibuffer view.editor set after construction may cause nil access #23

Open xenolandscapes.com
Open opened by xenolandscapes.com

Summary #

Minibuffer.new creates a view with editor=nil, and editor.minibuffer.view.editor is set later in Editor.new. If the render method is invoked before activation (e.g., from an alternative render path), accessing v.editor would cause a nil reference error.

The Problem #

In minibuffer.lua, the custom render function (defined in Minibuffer.new) immediately uses v.editor. However, v.editor is nil until Editor.new sets editor.minibuffer.view.editor = editor. Although the current activation path ensures render is only called when the minibuffer is active (checked via _handler_id), any future code path that calls render before activation would crash.

Impact #

  • category: correctness
  • description: minibuffer view.editor is nil until Editor.new sets it; render invoked before activation crashes

Set view.editor in Minibuffer.new by passing the editor as a parameter, or add a nil guard in the render function: if not v.editor then return end.


Commit range: c022da8..c022da8
Code Review: CR-2026-07-27-11

Sign up or Sign in to add to the discussion.