Skip to content

Commit

Permalink
fix: check if body is null (emacs-lsp#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase authored Nov 1, 2024
1 parent 496dd3a commit ee1091c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dap-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -790,12 +790,13 @@ will be reversed."
(dap--send-message
(dap--make-request "source" (list :sourceReference sourceReference))
(dap--resp-handler
(-lambda ((&hash "body" (&hash "content" content)))
(switch-to-buffer (generate-new-buffer sourceReferenceKey))
(insert content)
(goto-char (point-min))
(forward-line (1- line))
(forward-char column))
(-lambda ((&hash "body" body))
(let ((content (if body (gethash "content" body) "")))
(switch-to-buffer (generate-new-buffer sourceReferenceKey))
(insert content)
(goto-char (point-min))
(forward-line (1- line))
(forward-char column)))
(lambda (errmsg)
(message "No source code for %s. Cursor at %s:%s. Error: %s." name line column errmsg)))
debug-session))))
Expand Down

0 comments on commit ee1091c

Please sign in to comment.