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

Unhandled exception if feature ID not specified correctly #58

Closed
riverar opened this issue Aug 25, 2022 · 4 comments
Closed

Unhandled exception if feature ID not specified correctly #58

riverar opened this issue Aug 25, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@riverar
Copy link
Contributor

riverar commented Aug 25, 2022

Summary

When silly users, like me, specify feature IDs via /id 123456 instead of /id:123456 per the documentation, an unhandled exception occurs. (I only call this out because this also triggers my JIT debugger and interrupts my workflows.)

Version

ViVeTool v0.3.1

Steps to reproduce

  1. Issue command: vivetool /enable /id 123456
  2. Observe exception
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Albacore.ViVeTool.ArgumentBlock.Initialize(String[] args, ArgumentBlockFlags flags)
   at Albacore.ViVeTool.Program.ProcessArgs(String[] args)
   at Albacore.ViVeTool.Program.Main(String[] args)
@riverar
Copy link
Contributor Author

riverar commented Aug 25, 2022

Checking if value is null for various options in ArgumentBlock.cs and falling through if so seems to be the simplest fix here. Doing so will result in this output:

ViVeTool v0.3.1 - Windows feature configuration tool

Unrecognized parameter: /id

Unrecognized parameter: 123

No features were specified

If you're okay with that @thebookisclosed, I can submit a simple PR.

@thebookisclosed
Copy link
Owner

I'll take a look later this week, already have one more small change I want to push. No need for a PR.

@thebookisclosed thebookisclosed added the bug Something isn't working label Oct 16, 2022
@thebookisclosed
Copy link
Owner

Fixed in v0.3.2 (56e0bb4)

@riverar
Copy link
Contributor Author

riverar commented Oct 19, 2022

Thanks @thebookisclosed!

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

2 participants