TypeError thrown

get_class(): Argument #1 ($object) must be of type object, null given