Add a null check to prevent NullPointerException when a database does not support user-defined data types.