Informix Error -1392: Cannot use a NULL object.
Cause and resolution
Cannot use a NULL object.
In the p-code runner, an attempt was made to dereference a NULL object. Perhaps the program has defined an object, then tried to invoke a member function of the object before creating it through !copy() or !derive().
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1392 fires in the p-code runner when a NULL object is dereferenced — per the official
guidance, this typically happens when a program defines an object but tries to invoke a member
function on it before actually instantiating it (e.g. via !copy() or !derive()).
- A member function invoked on an object variable that was never instantiated, per the official guidance — the direct, common cause.
- An object variable that's genuinely
NULLat the point of use, from earlier logic that set it that way (or never set it at all).
Solutions / Resolution
- Instantiate the object before invoking member functions on it, per the official
guidance — via
!copy(),!derive(), or the appropriate construction mechanism for the class. - Check whether the object could genuinely be
NULLat this point in the logic, and guard against invoking members on it if so.
Examples
Invoking a member function on an uninstantiated object
DEFINE v_order Order.Class
CALL v_order.getTotal()
-- -1392: v_order was never instantiated
Corrected
DEFINE v_order Order.Class
LET v_order = NEW Order.Class()
CALL v_order.getTotal()
Diagnostic Checks
- Trace the object variable's lifecycle back to confirm whether and where it was actually instantiated before the failing member-function call.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -1392 in this set yet.
A NULL object was dereferenced — instantiate it before invoking member functions.