Skip to content

Fix GlobalSettings crash when JFrog CLI is not installed (XRAY-145646)#531

Merged
Jordanh1996 merged 4 commits into
jfrog:masterfrom
Jordanh1996:fix/XRAY-145646-global-settings-npe
Jun 17, 2026
Merged

Fix GlobalSettings crash when JFrog CLI is not installed (XRAY-145646)#531
Jordanh1996 merged 4 commits into
jfrog:masterfrom
Jordanh1996:fix/XRAY-145646-global-settings-npe

Conversation

@Jordanh1996

Copy link
Copy Markdown
Contributor

Summary

Fixes XRAY-145646 — IntelliJ plugin 2.9.0 fails to start on Windows with:

PluginException: Cannot init component state (GlobalSettings)
Caused by: NullPointerException: Cannot invoke Log.error() because "this.log" is null
  at JfrogCliDriver.runVersion → isJfrogCliInstalled

Root cause: ide-plugins-common 2.4.x (#525) changed JfrogCliDriver(Map, String path) to JfrogCliDriver(Map, Log). ServerConfigImpl.readConnectionDetailsFromJfrogCli() still passed null as the second argument — previously the CLI path, now the Log. When jf is not on PATH (common on Windows), isJfrogCliInstalled() calls log.error() and NPEs during GlobalSettings init.

Fix: Pass new NullLog() instead of null when constructing JfrogCliDriver.

Test plan

  • Reproduced NPE on Windows VM without jf on PATH (broken 2.9.0 build)
  • Verified fixed build: IntelliJ starts, Global Configuration saves and persists across restart
  • ConnectionDetailsFromCliTest updated and passes

Made with Cursor

After ide-plugins-common 2.4.x, JfrogCliDriver's second constructor arg is Log, not CLI path.
Passing null caused NPE in isJfrogCliInstalled() on Windows where jf is often missing from PATH.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Jordanh1996 Jordanh1996 requested a review from attiasas June 16, 2026 14:47
@Jordanh1996 Jordanh1996 marked this pull request as ready for review June 16, 2026 14:48
@attiasas attiasas added the bug Something isn't working label Jun 17, 2026

@attiasas attiasas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I would try to add test that could replicate the issue you fixed

Simulates missing jf by pointing PATH at an empty directory so
isJfrogCliInstalled() exercises the log path without mutating the host env.

Co-authored-by: Cursor <cursoragent@cursor.com>
CommandExecutor merges System.getenv() and appends /usr/local/bin on Unix,
so PATH isolation cannot reliably hide jf on macOS/ubuntu CI. Use
mockConstruction instead and assert JfrogCliDriver receives a non-null Log.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Jordanh1996 Jordanh1996 merged commit fd72833 into jfrog:master Jun 17, 2026
8 of 9 checks passed
@Jordanh1996 Jordanh1996 deleted the fix/XRAY-145646-global-settings-npe branch June 17, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants