forked from LiveCarta/PayPal-PHP-SDK
Merge pull request #767 from paypal/getlinks
Don't iterate if object is null
This commit is contained in:
@@ -41,9 +41,11 @@ class PayPalResourceModel extends PayPalModel implements IResource
|
|||||||
|
|
||||||
public function getLink($rel)
|
public function getLink($rel)
|
||||||
{
|
{
|
||||||
foreach ($this->links as $link) {
|
if (is_array($this->links)) {
|
||||||
if ($link->getRel() == $rel) {
|
foreach ($this->links as $link) {
|
||||||
return $link->getHref();
|
if ($link->getRel() == $rel) {
|
||||||
|
return $link->getHref();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user