Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
Don't iterate if object is null
Browse files Browse the repository at this point in the history
- Fixes #766.
  • Loading branch information
jaypatel512 authored Jan 16, 2017
1 parent 8359fa8 commit 1f87129
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/PayPal/Common/PayPalResourceModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ public function getLinks()

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;
Expand Down

0 comments on commit 1f87129

Please sign in to comment.