File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed 
OurUmbraco/Forum/Controllers Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1- using  System . Linq ; 
1+ using  System . Collections . Generic ; 
2+ using  System . Linq ; 
23using  System . Web . Mvc ; 
3- using  OurUmbraco . Community . People ; 
44using  OurUmbraco . Forum . Services ; 
55using  Umbraco . Web . Mvc ; 
66
@@ -11,9 +11,14 @@ public class LatestActivityController : SurfaceController
1111        public  ActionResult  LatestActivity ( int  numberOfTopics  =  10 ) 
1212        { 
1313            var  discourseService  =  new  DiscourseService ( ) ; 
14-             var  discourseTopics  =  discourseService . GetLatestTopics ( "questions" ,  5 ) . Take ( numberOfTopics ) . ToList ( ) ; 
14+             var  discourseTopics  =  discourseService . GetLatestTopics ( "questions" ,  5 ) ; 
15+             var  topics  =  new  List < Models . DiscourseTopic > ( ) ; 
16+             if ( discourseTopics  !=  null ) 
17+             { 
18+                 topics  =  discourseTopics . Take ( numberOfTopics ) . ToList ( ) ; 
19+             } 
1520
16-             return  PartialView ( "~/Views/Partials/Home/LatestForumActivity.cshtml" ,  discourseTopics ) ; 
21+             return  PartialView ( "~/Views/Partials/Home/LatestForumActivity.cshtml" ,  topics ) ; 
1722        } 
1823    } 
1924} 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments