Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 2632da4

Browse files
committed
return error when source is not provided and include-mint flag is not present for withdraw-withheld-tokens command
1 parent 5cd5479 commit 2632da4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

token/cli/src/command.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,6 +2841,11 @@ async fn command_withdraw_withheld_tokens(
28412841
if config.sign_only {
28422842
panic!("Config can not be sign-only for withdrawing withheld tokens.");
28432843
}
2844+
if source_token_accounts.is_empty() && !include_mint {
2845+
return Err("No source accounts for withheld tokens provided. \
2846+
Please include a list of pubkeys to withdraw from, or the --include-mint \
2847+
flag to withdraw tokens withheld in the mint.".into());
2848+
}
28442849
let destination_account = config
28452850
.get_account_checked(&destination_token_account)
28462851
.await?;

0 commit comments

Comments
 (0)