$userVendor
is null and you’re trying to get its property. That’s exactly what’s stated in the error message.
To be more precise, your DB query (findOne()) did not return a result. You have to check if ($userVendor !== null) { ... }
before using it.
I would also suggest to move the, query and (if check) in your controller
Thankyou everyone.