Skip to content

## Fix: Add Bounds Checking to Index-Based Getter Functions in load_config.py#80

Open
santhil-cyber wants to merge 1 commit intofwitmer:masterfrom
santhil-cyber:master
Open

## Fix: Add Bounds Checking to Index-Based Getter Functions in load_config.py#80
santhil-cyber wants to merge 1 commit intofwitmer:masterfrom
santhil-cyber:master

Conversation

@santhil-cyber
Copy link

All five index-based getter functions were accessing file lists with no bounds checking, causing raw unhelpful IndexError crashes when an out-of-range index was passed.

Each function now:

  1. Extracts the file list into a local variable
  2. Validates the index is within range (0 to len - 1)
  3. Raises a descriptive IndexError with the valid range if out of bounds

Affected functions: get_image_path(), get_raw_data_path(), get_shapefile_path(), get_ground_truth_path(), get_aligned_data_path()

Closes #79

- Add bounds validation to get_image_path, get_raw_data_path,
  get_shapefile_path, get_ground_truth_path, get_aligned_data_path
- Raise descriptive IndexError with valid range when index out of bounds
- Prevents silent failures and improves debugging
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.

[BUG] Missing Bounds Checking in Index-Based Getter Functions in load_config.py

1 participant