Skip to content

Refactor ZipscriptMP3Handler and add JUnit test for invalid MP3s#504

Open
tsautier wants to merge 2 commits intodrftpd-ng:masterfrom
tsautier:fix/issue-77
Open

Refactor ZipscriptMP3Handler and add JUnit test for invalid MP3s#504
tsautier wants to merge 2 commits intodrftpd-ng:masterfrom
tsautier:fix/issue-77

Conversation

@tsautier
Copy link
Copy Markdown

@tsautier tsautier commented Jan 14, 2026

Problem

When encountering an invalid MP3 file, the slave would throw an IOException with message "X is not a valid MP3 file", causing errors in the async command handler.

Solution

Catch the specific IOException in ZipscriptMP3Handler.getMP3File() and return null instead of propagating the exception. This allows graceful handling of invalid MP3 files.

Changes Made

  • Modified ZipscriptMP3Handler.java to catch IOException when parsing MP3 files
  • If the error message indicates an invalid MP3 file, return null instead of throwing
  • Other IOExceptions are still propagated

Fixes: #77

@tsautier
Copy link
Copy Markdown
Author

@mvangoor @hrxcodes for review

@tsautier tsautier changed the title Fix/issue 77 Refactor ZipscriptMP3Handler and add JUnit test for invalid MP3s Jan 14, 2026
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.

MP3 problem

1 participant