Skip to content

fix: guard against empty height_grid in fill_nan_values and filter_elevation_outliers - #786

Merged
louis-e merged 1 commit into
mainfrom
fix/elevation-data-empty-grid
Mar 14, 2026
Merged

louis-e merged 1 commit into
mainfrom
fix/elevation-data-empty-grid

Conversation

@louis-e

@louis-e louis-e commented Mar 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 14, 2026 18:02
@louis-e
louis-e merged commit 0960f3e into main Mar 14, 2026
2 of 3 checks passed
@louis-e
louis-e deleted the fix/elevation-data-empty-grid branch March 14, 2026 18:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent panics when processing elevation grids that may be empty by adding early returns in two internal grid-processing helpers.

Changes:

  • Add a height == 0 guard to fill_nan_values.
  • Add a height == 0 guard to filter_elevation_outliers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/elevation_data.rs
Comment on lines 646 to 651
fn fill_nan_values(height_grid: &mut [Vec<f64>]) {
let height: usize = height_grid.len();
if height == 0 {
return;
}
let width: usize = height_grid[0].len();
Comment thread src/elevation_data.rs
Comment on lines 689 to 695
fn filter_elevation_outliers(height_grid: &mut [Vec<f64>]) {
let height = height_grid.len();
if height == 0 {
return;
}
let width = height_grid[0].len();

Comment thread src/elevation_data.rs
Comment on lines +648 to +650
if height == 0 {
return;
}
@github-actions

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 32s
🧠 Peak memory usage: 1090 MB

📈 Compared against baseline: 30s
🧮 Delta: 2s
🔢 Commit: 2a5ee86

🟢 Generation time is unchanged.

📅 Last benchmark: 2026-03-14 18:05:42 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants