Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on invalid command line arguments #80

Open
kyllingstad opened this issue Sep 29, 2020 · 0 comments
Open

NullPointerException on invalid command line arguments #80

kyllingstad opened this issue Sep 29, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@kyllingstad
Copy link
Member

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.)

@kyllingstad kyllingstad added the bug Something isn't working label Sep 29, 2020
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

No branches or pull requests

1 participant