Closed MODUSCarstenScholling closed 4 years ago
Try to use someOptions: Option FirstOption,"",LastOption;
This warning was weird to us to because it didn't highlight the option with wrong options, instead reported problem in app.json file.
Well, it's not the option or the option values that are the problem, but rather the fact that something like that, which is valid code, must not lead to an exception without getting information about the code position. Fixing is our smallest problem.
Fixed
Thank you!
Describe the bug A combination of an Option parameter with empty string and local variable declaration causing an ArgumentNullException in CodeCop.
To Reproduce
The above procedure causes the following exception: Analyzer 'Microsoft.Dynamics.Nav.CodeCop.Design.Rule137DoNotDeclareVariablesThatAreUnused' threw an exception of type 'System.ArgumentNullException' with message 'System.ArgumentNullException: Value cannot be null.
If you either remove the local variable OR give a proper name to the empty option, the exception disappears.
Exception
NO Exception
NO Exception
Expected behavior No exception in first example procedure.
Versions:
Example app: AnalyzerException.zip