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.
at VI.DB.Scripting.ScriptBase.get_Connection()
at DynScripts.Scripts_gLBIVytfS6cuRKH8YHvRzBkQMKg..ctor()"
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"))
End If
If debug Then
' ...
End If
End Function
/---
If variables outside the script definition is required then the above workaround is required for every variable.
© 2024 One Identity LLC. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center