Reject object references that cannot be resolved
When an object id did not match registered or wrapped object,
toVariant() warned and then returned a variant holding a null QObject*
anyway. The caller had no way to tell that apart from a legitimate JSON
null, so a method was invoked with a null argument and a property was
silently cleared.
Return std::nullopt instead and let callers abandon the call.
An explicit JSON null is still accepted as the intended way to pass a
null pointer.
Pick-to: 6.8 6.12
Task-number: QTBUG-151083
Change-Id: Icd7e88bc2866417e3fb8502a1e30d05aa722e7c4
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>