Skip to content

NullPointerException on invalid command line arguments #80

Description

@kyllingstad

When running

java -jar osp-cli.jar -fmu path/to/model.fmu

or

java -jar osp-cli.jar -file path/to/model_OspModelDescription.xml

I get error messages like the following:

Exception in thread "main" java.lang.NullPointerException
        at java.io.File.<init>(File.java:277)
        at com.opensimulationplatform.cli.Main.main(Main.java:85)

Presumably, the error occurs because both the -fmu and -file switches are mandatory, but the message does not indicate this. (Furthermore, IMO, a NullPointerException always represents a bug in the program, never a usage error.)

Also note that the mandatoriness of the options is not specified in the built-in usage documentation, so it's hard for a user to tell. (They're listed as "options", which at least seems to hint that they might be optional.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions