Fix error in dap--buffers-w-breakpoints
when a debug session ends
#836
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The error
The following error occurs when a debug session finishes and a buffer containing breakpoints was killed beforehand.
Reproducing
Environment
develop
, commitf150f1ba8c9d2cb497a790b85e46eaa1c81f7908
, withlsp
,java
,dap
layers enabled)Steps
debug-on-error
(Runtoggle-debug-on-error
).MainA
,MainB
.MainB
and then kill the buffer.MainA
withdap-debug
.Result
A
*Backtrace*
buffer containing the above error is shown.Cause & Solution
The error lies in the following function where
(plist-get (car it) :marker)
returnsnil
which is unacceptable tomarker-buffer
. This occurs when a buffer containing breakpoints was killed, which causes the absence of the:marker
value in the result of(dap--get-breakpoints)
. The solution here is to add anil
-check.