Inherited a piece of code where an update to a plugin has started causing this error
Fatal error: Call to a member function getId() on a non-object in...
Where the line in question is $shippingId = $order->getShippingAddress()->getId();
The update to the surrounding code, means that this function returning nothing is fine and the rest of the code can function with $shippingId
not existing
What I need is a method of saying
if ($shippingId = $order->getShippingAddress()->getId() WORKS)
do_these_things()
and then instead of error'ing just carries on if not