Skip to content

fix: return early if no modules exist when displaying dependent modules #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

Integral-Tech
Copy link
Contributor

@Integral-Tech Integral-Tech commented Apr 15, 2025

Description

When displaying dependent modules, check whether the list is empty and return early.

Motivation and Context

Currently, when no modules exist, pressing "D" or "Alt+D" to display dependent modules will crash the program.

thread 'main' panicked at src/app.rs:250:13:
index out of bounds: the len is 0 but the index is 0

How Has This Been Tested?

Tested in a QEMU virtual machine, with direct kernel boot (no initramfs).

Screenshots / Output (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation and changelog accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Rustfmt and Rust-clippy passed.

Currently, when no modules exist, pressing "D" or "Alt+D" to display
dependent modules will crash the program. Check whether the list is
empty and return early to solve this problem.
Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

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

Thanks!

@orhun orhun merged commit ae88b94 into orhun:master Apr 16, 2025
4 of 5 checks passed
@Integral-Tech Integral-Tech deleted the fix-empty-list branch April 16, 2025 09:13
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