Skip to content

Commit 5dba90d

Browse files
cyberkaidaCopilot
andauthored
Update src/main/java/reva/plugin/ConfigManager.java
Co-authored-by: Copilot <[email protected]>
1 parent 234b7f9 commit 5dba90d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/reva/plugin/ConfigManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ private void registerOptionsWithGhidra() {
9898

9999
// Only generate a new API key if one does not already exist
100100
String existingApiKey = toolOptions.getString(API_KEY, null);
101-
String apiKeyToRegister = (existingApiKey != null && !existingApiKey.isEmpty()) ? existingApiKey : generateDefaultApiKey();
101+
boolean isApiKeyMissing = (existingApiKey == null || existingApiKey.isEmpty());
102+
String apiKeyToRegister = isApiKeyMissing ? generateDefaultApiKey() : existingApiKey;
102103
toolOptions.registerOption(API_KEY, apiKeyToRegister, help,
103104
"API key required for MCP server access when authentication is enabled");
104105

105106
// Ensure the generated key is actually set in the options
106-
if (existingApiKey == null || existingApiKey.isEmpty()) {
107+
if (isApiKeyMissing) {
107108
toolOptions.setString(API_KEY, apiKeyToRegister);
108109
}
109110
toolOptions.registerOption(DEBUG_MODE, DEFAULT_DEBUG_MODE, help,

0 commit comments

Comments
 (0)