diff --git a/lib/PayPal/Common/PayPalResourceModel.php b/lib/PayPal/Common/PayPalResourceModel.php index 927a379..6b40e8f 100644 --- a/lib/PayPal/Common/PayPalResourceModel.php +++ b/lib/PayPal/Common/PayPalResourceModel.php @@ -41,9 +41,11 @@ class PayPalResourceModel extends PayPalModel implements IResource public function getLink($rel) { - foreach ($this->links as $link) { - if ($link->getRel() == $rel) { - return $link->getHref(); + if ($this->links) { + foreach ($this->links as $link) { + if ($link->getRel() == $rel) { + return $link->getHref(); + } } } return null;