When creating custom scripts, variables were defined outside of a custom script definition. Compilation will succeed with no errors, however when running Identity Manager (1IM) tools the following error will be presented:
"System.NullReferenceException: Object reference not set to an instance of an object.
A full compilation of the database will not resolve the error in this case.
Variables defined in the scripts, but outside of the script definitions. Each static variable outside of the script definitions would lead to the error. This is not supported in One Identity Manager.
As a workaround, to allow variables outside the script definition, initialize the variable during the first usage inside of the scripts. For example:
Dim debug As Boolean?
Public Function Bla()
If Not debug.HasValue Then
debug = Convert.ToBoolean(Connection.GetConfigParm("Custom\TargetSystem\HUON\Debug"))
If debug Then
If variables outside the script definition is required then the above workaround is required for every variable.