Skip to content

Commit

Permalink
check for valid abs path first
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmaddock committed Jan 10, 2025
1 parent 4347816 commit 1ff052e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/symbolicator-js/src/symbolication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ async fn symbolicate_js_frame(
should_apply_source_context: bool,
stats: &mut SymbolicationStats,
) -> Result<JsFrame, JsModuleErrorKind> {
let Some(abs_path) = &raw_frame.abs_path else {
return Err(JsModuleErrorKind::InvalidAbsPath);
};

// we check for a valid line (i.e. >= 1) first, as we want to avoid resolving / scraping the minified
// file in that case. we frequently saw 0 line/col values in combination with non-js files,
// and we want to avoid scraping a bunch of html files in that case.
Expand All @@ -115,10 +119,6 @@ async fn symbolicate_js_frame(
}
};

let Some(abs_path) = &raw_frame.abs_path else {
return Err(JsModuleErrorKind::InvalidAbsPath);
};

let col = raw_frame.colno.unwrap_or_default();

let module = lookup.get_module(&abs_path).await;
Expand Down

0 comments on commit 1ff052e

Please sign in to comment.