r7-labs / R7.News

Taxonomy-driven news subsystem for DNN Platform
GNU Affero General Public License v3.0
2 stars 3 forks source link

Null reference exception in NewsRepository.GetNewsEntriesByTerms_Count #17

Open roman-yagodin opened 7 years ago

roman-yagodin commented 7 years ago

Stack trace:

   at R7.News.Data.NewsRepository.m__1(Term t)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at R7.News.Data.NewsRepository.GetNewsEntriesByTerms_Count(Int32 portalId, Boolean checkNow, DateTime now, Int32 minThematicWeight, Int32 maxThematicWeight, Int32 minStructuralWeight, Int32 maxStructuralWeight, IList`1 terms)
   at R7.News.Stream.ViewModels.StreamViewModel.GetFirstPageInternal(Int32 pageSize, Boolean checkNow, DateTime now)
   at R7.News.Stream.ViewModels.StreamViewModel.c__AnonStorey0.<>m__0(CacheItemArgs c)
   at DotNetNuke.Common.Utilities.DataCache.GetCachedDataFromRuntimeCache(CacheItemArgs cacheItemArgs, CacheItemExpiredCallback cacheItemExpired)
roman-yagodin commented 7 years ago

Caused by outdated viewmodel context or something?

roman-yagodin commented 7 years ago

Seems to fixed by 39b6fa1 as GetNewsEntriesByTerms_Count() will just return 0 if list of terms is empty.