]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticelist.php
move UAP plugin to core
[quix0rs-gnu-social.git] / lib / noticelist.php
index 4c11ceed6cecf60dcf4b191bece29d503745d0fa..78abf34a76d512bb6fd289fbd6f4a5ce4fabf153 100644 (file)
@@ -191,6 +191,14 @@ class NoticeListItem extends Widget
 
     function show()
     {
+        if (empty($this->notice)) {
+            common_log(LOG_WARNING, "Trying to show missing notice; skipping.");
+            return;
+        } else if (empty($this->profile)) {
+            common_log(LOG_WARNING, "Trying to show missing profile (" . $this->notice->profile_id . "); skipping.");
+            return;
+        }
+
         $this->showStart();
         if (Event::handle('StartShowNoticeItem', array($this))) {
             $this->showNotice();
@@ -371,7 +379,7 @@ class NoticeListItem extends Widget
 
     function showNoticeLink()
     {
-        if($this->notice->is_local){
+        if($this->notice->is_local == Notice::LOCAL_PUBLIC || $this->notice->is_local == Notice::LOCAL_NONPUBLIC){
             $noticeurl = common_local_url('shownotice',
                                       array('notice' => $this->notice->id));
         }else{