Categories
CMS Drupal Mastering Development

Trying to get property of non-object throws exception that cannot be handled

In a custom Drupal 8 module I decided to wrap a line of code in a try…catch block, in case $node was null. I understand that in php errors and exceptions are different, and according to Error message – Trying to get property of non-object this is an error, so will not be handled by […]