From 573cb399261f9ab8f799dcf82a40220dcc6539e4 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Thu, 2 Dec 2021 10:20:19 +0900 Subject: dap: Remove some unwraps --- helix-term/src/application.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'helix-term/src/application.rs') diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 3d6d00fe..b6753ec5 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -388,18 +388,20 @@ impl Application { } Event::Breakpoint(events::Breakpoint { reason, breakpoint }) => match &reason[..] { "new" => { - self.editor - .breakpoints - .entry(breakpoint.source.unwrap().path.unwrap()) // TODO: no unwraps - .or_default() - .push(Breakpoint { - id: breakpoint.id, - verified: breakpoint.verified, - message: breakpoint.message, - line: breakpoint.line.unwrap().saturating_sub(1), // TODO: no unwrap - column: breakpoint.column, - ..Default::default() - }); + if let Some(source) = breakpoint.source { + self.editor + .breakpoints + .entry(source.path.unwrap()) // TODO: no unwraps + .or_default() + .push(Breakpoint { + id: breakpoint.id, + verified: breakpoint.verified, + message: breakpoint.message, + line: breakpoint.line.unwrap().saturating_sub(1), // TODO: no unwrap + column: breakpoint.column, + ..Default::default() + }); + } } "changed" => { for breakpoints in self.editor.breakpoints.values_mut() { -- cgit v1.2.3-70-g09d2