File tree Expand file tree Collapse file tree
examples/oft-solana/tasks/solana Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,6 +235,11 @@ async function updateTokenExtensionsMetadata({
235235 throw new Error ( `Mint account not found: ${ mintStr } ` )
236236 }
237237
238+ const hasFieldUpdates = Boolean ( name || symbol || uri )
239+ if ( ! hasFieldUpdates ) {
240+ throw new Error ( 'At least one of --name, --symbol, or --uri must be provided' )
241+ }
242+
238243 // Build instructions for each field that needs updating
239244 const instructions = [ ]
240245
@@ -309,10 +314,6 @@ async function updateTokenExtensionsMetadata({
309314 )
310315 }
311316
312- if ( instructions . length === 0 ) {
313- throw new Error ( 'At least one of --name, --symbol, or --uri must be provided' )
314- }
315-
316317 const { blockhash } = await connection . getLatestBlockhash ( )
317318
318319 const message = new TransactionMessage ( {
You can’t perform that action at this time.
0 commit comments