Throw an exception converting fave to activity for non-existent notice or profile
This commit is contained in:
		@@ -125,8 +125,17 @@ class Fave extends Managed_DataObject
 | 
				
			|||||||
    function asActivity()
 | 
					    function asActivity()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $notice = Notice::staticGet('id', $this->notice_id);
 | 
					        $notice = Notice::staticGet('id', $this->notice_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (!$notice) {
 | 
				
			||||||
 | 
					            throw new Exception("Fave for non-existent notice: " . $this->notice_id);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $profile = Profile::staticGet('id', $this->user_id);
 | 
					        $profile = Profile::staticGet('id', $this->user_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (!$profile) {
 | 
				
			||||||
 | 
					            throw new Exception("Fave by non-existent profile: " . $this->user_id);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $act = new Activity();
 | 
					        $act = new Activity();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $act->verb = ActivityVerb::FAVORITE;
 | 
					        $act->verb = ActivityVerb::FAVORITE;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user