From f451804c6d82bfbf214f08717c66684da66ca328 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 19 Jun 2010 15:00:44 -0700 Subject: $request->params might not exist. --- modules/tag/helpers/tags_rest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'modules/tag') diff --git a/modules/tag/helpers/tags_rest.php b/modules/tag/helpers/tags_rest.php index 975cf140..4f40e7f4 100644 --- a/modules/tag/helpers/tags_rest.php +++ b/modules/tag/helpers/tags_rest.php @@ -29,9 +29,13 @@ class tags_rest_Core { static function get($request) { $tags = array(); - $p = $request->params; - $num = isset($p->num) ? min((int)$p->num, 100) : 10; - $start = isset($p->start) ? (int)$p->start : 0; + $num = 10; + $start = 0; + if (isset($request->params)) { + $p = $request->params; + $num = isset($p->num) ? min((int)$p->num, 100) : 10; + $start = isset($p->start) ? (int)$p->start : 0; + } foreach (ORM::factory("tag")->find_all($num, $start) as $tag) { $tags[] = rest::url("tag", $tag); -- cgit v1.2.3