The error message should tell you which file and on what line the error is occurring. Presumably that line will have something along the lines of:
$object_name->some_method()
You need to find out where $object_name is defined, ensure that it is actually being successfully instantiated, and that it is not subsequently being destroyed.
Another possibility is that you are running under a too-old version of PHP and that the code is trying to do something like:
$object_name->method_that_returns_an_object()->method_in_that_new_object()
If that is the case and upgrading your PHP installation is not an option, then you would need to change it to something like:
$new_object = $object_name->method_that_returns_an_object();
$new_object->method_in_that_new_object();