Bug Description
setNetwork in src/commands/network/setNetwork.ts (lines 46-60)
incorrectly handles empty string input, bypassing the interactive
prompt and showing a malformed error message.
Root Cause
asyncsetNetwork(networkName?: string): Promise<void>{if(networkName||networkName===""){// empty string enters this branchif(!networks.some(n=>n.name===networkName||n.alias===networkName)){this.failSpinner(`Network ${networkName} not found`);// displays "Network not found"return;}}// interactive prompt — never reached for empty string}Impact
When user runs genlayer network set "", the empty string
enters the non-interactive branch. No network matches empty
string, so error displays "Network not found" (with blank space).
The interactive prompt is never shown, confusing the user.
Suggested Fix
// Change condition from:if(networkName||networkName===""){// To:if(networkName){// falsy check — sends empty string to interactive promptFile
src/commands/network/setNetwork.ts lines 46-60
Severity: Medium
Bug Description
setNetworkinsrc/commands/network/setNetwork.ts(lines 46-60)incorrectly handles empty string input, bypassing the interactive
prompt and showing a malformed error message.
Root Cause
Impact
When user runs
genlayer network set "", the empty stringenters the non-interactive branch. No network matches empty
string, so error displays "Network not found" (with blank space).
The interactive prompt is never shown, confusing the user.
Suggested Fix
File
src/commands/network/setNetwork.tslines 46-60Severity: Medium