Also check if the type is a QVariantMap, because that can safely be cast to a json object. (cherry picked from commit 4233d58d)