Skip to content

Commit fe15b35

Browse files
committed
Show info about state if frames are missing in frames widget
1 parent 4377a05 commit fe15b35

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lua/dap/ui/widgets.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,17 @@ M.frames = {
228228
layer.render({'Not stopped at any breakpoint. No frames available'})
229229
return
230230
end
231-
local frames = (session.threads[session.stopped_thread_id] or {}).frames or {}
231+
local thread = session.threads[session.stopped_thread_id]
232+
if not thread then
233+
local msg = string.format("Stopped thread (%d) not found. Can't display frames", session.stopped_thread_id)
234+
layer.render({msg})
235+
return
236+
end
237+
local frames = thread.frames
238+
if not frames then
239+
layer.render({"Stopped thread has no frames"})
240+
return
241+
end
232242
local context = {}
233243
context.actions = {
234244
{

0 commit comments

Comments
 (0)