Sample Code:
Dim myObject
Set myObject = JSON.parse(someJsonResponseFromTheServer)
myFunction(myObject.someProperty)
The Problem:
When code similiar to this is ran in my application, it throws a 500
error from the server with a message similar to "Object Does not support property or method 'someProperty'. What I would like to do to solve this problem is something like this:
Dim myObject
Set myObject = JSON.parse(someJsonResponseFromTheServer)
If myObject.someProperty Then
myFunction(myObject.someProperty)
End If
However, if I add the conditional, it throws the same error on the line with the conditional instead of the line with the method call.
My Question:
In ASP Classic, how do you detect if a property exists within an object without throwing an error?