[RFC]CID 71507: Unchecked return value (CHECKED_RETURN)

Check for the return value of object_to_vim instead of checking for err.set
should be `|| err.set`