From: Mikael Nordfeldth Date: Sat, 6 Dec 2014 18:56:21 +0000 (+0100) Subject: Avoid undefined variables. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=48680942fd4f4d90a3d121e6da7f9f8d47dd01da;p=quix0rs-gnu-social.git Avoid undefined variables. --- diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index b105a29dd1..26c960fa04 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -134,12 +134,17 @@ class ApiTimelineUserAction extends ApiBareAuthAction 'id' => $this->target->id), array('max_id' => $this->next_id)) : null; - $lastNotice = $this->notices[0]; - $lastId = $lastNotice->id; + + $prevExtra = array(); + if (!empty($this->notices)) { + assert($this->notices[0] instanceof Notice); + $prevExtra['since_id'] = $this->notices[0]->id; + } + $prevUrl = common_local_url('ApiTimelineUser', array('format' => $this->format, 'id' => $this->target->id), - array('since_id' => $lastId)); + $prevExtra); $firstUrl = common_local_url('ApiTimelineUser', array('format' => $this->format, 'id' => $this->target->id));