aboutsummaryrefslogtreecommitdiffhomepage
path: root/core
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2022-02-24 00:07:40 -0500
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2022-02-24 00:07:40 -0500
commitd964123cd968a1bda854bbc6931677994d03bd33 (patch)
treea1c196255a0a948810b1821a09512567c673624d /core
parentde1e80584a92c0878199553ae0b9c7743743e33d (diff)
Fixed potential crash caused by r3219.
Ensure the view exists.
Diffstat (limited to 'core')
-rw-r--r--core/ui.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ui.lua b/core/ui.lua
index 8a57a160..263f6a54 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -272,7 +272,7 @@ function ui.goto_file(filename, split, preferred_view, sloppy)
if #_VIEWS == 1 and split and not (view.buffer.filename or ''):find(patt) then
view:split()
else
- local other_view = preferred_view
+ local other_view = _VIEWS[preferred_view] and preferred_view
for _, view in ipairs(_VIEWS) do
local view_filename = view.buffer.filename or ''
if view_filename:find(patt) then