I often get "[Notice] Trying to get property of non-object". I would like to find an easy way to test if my variable is an object or not so I can handle the error myself in a more graceful way. Is there a function to test if something is an object?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Although, usually you can just make sure if its set, if its set then usually you can assume its an object if($object).....