diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index 4594bb37ec..4cb388fb1f 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -223,7 +223,7 @@ class RemotesubscribeAction extends Action { foreach ($types as $type) { $matches = $xrd->services(omb_service_filter($type)); if ($matches) { - $omb[$type] = $services[0]; + $omb[$type] = $matches[0]; } else { # no match for type return false; diff --git a/lib/omb.php b/lib/omb.php index ae7531ce8e..fc873d0d52 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -86,6 +86,9 @@ function omb_service_uri($service) { } function omb_local_id($service) { + if (!$service) { + return NULL; + } $els = $service->getElements('LocalID'); return ($els) ? $els[0] : NULL; }