CXone Studio ASSIGN and IF logic for branching on null values

Looking for advice on handling null returns in Studio snippets.

If the result is null, the IF condition evaluates to false.

The docs are vague on type casting. My current snippet fails silently when GetRESTProxy returns nothing.

ASSIGN var result = GetRESTProxy("/api/v2/users/me")
IF result IS NOT NULL THEN
 ASSIGN var id = result.id
END IF

Is IS NOT NULL the correct syntax for checking the object existence before accessing properties?

To fix this easily, this is to use IS NULL directly, since IS NOT NULL isn’t valid Studio syntax. Try IF result IS NULL THEN ... ELSE ASSIGN var id = result.id END IF.