Skip to content

[ISSUE] NullPointerException in UserAgent.env() when PATH environment variable is missing #550

@lk255018

Description

@lk255018

Description
When running on a system where the PATH environment variable is not set, the following code in UserAgent.env() causes a NullPointerException:
System.getenv("PATH").split(File.pathSeparator)
System.getenv("PATH").split(File.pathSeparator)

If System.getenv("PATH") returns null, calling .split() throws an exception.

Reproduction
Unset the PATH environment variable.
Run any code that triggers UserAgent.env().

Expected behavior
The code should handle missing PATH gracefully, e.g., by using an empty array.

Is it a regression?
this is introduced in databricks-sdk-java-0.40.0.jar

Debug Logs

Other Information

  • OS: [e.g. macOS]
  • Version: I am using 0.67.3 version

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions