
I recently encountered this issue with NAV2018 OnPrem relating to a DotNet variable that has yet to be instantiated. This error usually happens when you haven’t initialised the constructor. To fix this issue, perform an ISNULL check and initialise the constructer. Here is an example of the code.
if IsNull(HttpWebResponse) then
HttpWebResponse := HttpWebResponse.HttpWebResponse();
I hope that helps you if you have the same issue with NAV2018.