Skip to content

blob CLI: prevent panic when using --input-file without positional args#4819

Open
Sushil-19 wants to merge 1 commit intocelestiaorg:mainfrom
Sushil-19:fix-cli-blob-submit-args
Open

blob CLI: prevent panic when using --input-file without positional args#4819
Sushil-19 wants to merge 1 commit intocelestiaorg:mainfrom
Sushil-19:fix-cli-blob-submit-args

Conversation

@Sushil-19
Copy link

Fixes #4625

This PR fixes a runtime panic in the celestia blob submit CLI command when --input-file is used without positional arguments.

Previously, PreRunE accessed args[0] and args[1] unconditionally, which caused:

panic: runtime error: index out of range [0] with length 0

when the command was executed as:

celestia blob submit --input-file input.json

The fix skips positional argument processing when --input-file is provided and validates arguments only when necessary.

This prevents the panic and ensures the CLI returns proper validation errors instead.

@github-actions github-actions bot requested a review from vgonkivs March 4, 2026 06:41
@github-actions github-actions bot added the external Issues created by non node team members label Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Issues created by non node team members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refinement of CLI tool argument handling

1 participant