From: agrabs Date: Sat, 17 May 2008 14:11:18 +0000 (+0000) Subject: fixed notice-message X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b9fb72f7afa6fd5b84f40ee77aab6d5151d86e70;p=moodle.git fixed notice-message --- diff --git a/mod/feedback/edit.php b/mod/feedback/edit.php index 13a7d5599f..0f66ab7ab3 100644 --- a/mod/feedback/edit.php +++ b/mod/feedback/edit.php @@ -113,8 +113,12 @@ $feedbackitems = get_records('feedback_item', 'feedback', $feedback->id, 'position'); if(is_array($feedbackitems)){ $feedbackitems = array_values($feedbackitems); - $lastitem = $feedbackitems[count($feedbackitems)-1]; - $lastposition = $lastitem->position; + if(count($feedbackitems) > 0) { + $lastitem = $feedbackitems[count($feedbackitems)-1]; + $lastposition = $lastitem->position; + }else { + $lastposition = 0; + } } $lastposition++;