Error when adding new story with a non-administrative account

Jan 24, 2009 at 11:15 PM
Edited Jan 24, 2009 at 11:49 PM
I'm getting the error message 'System.NullReferenceException: Object reference not set to an instance of an object.' in SpamPostprocessor.Process line 37.

IStory approvingStory = _storyRepository.FindById(story.Id);

In StoryService.Create line 124 _spamPostprocessor.Process(source, isSpam, detailUrl, story) is called but only for non administrative accounts.   I added a check for null in SpamPostprocess.Process before setting the Approve property for now.


Just wanted to add that this is a very cool project and nicely done.
Feb 4, 2009 at 3:38 AM
I have just updated it RC 1 do let me know if you are still getting this error.
Feb 8, 2009 at 3:33 PM
Error still exists. To avoid error I add some check on null:

                if (approvingStory != null)

Feb 8, 2009 at 7:03 PM
@activekix : You should never reach that far with Admin. Spam is only checked when User is Public and has score below than 25 (This is the default behavior).

@XaocCPS: Pls do not do this, instead try to figure the issue with latest release there is different connection for doing this background Job, ensure you have the right configuration file.
Feb 10, 2009 at 5:27 PM
But I already have last release. And this error still exists. :-( After adding this part of code problem has gone.
What about configuration file? I have last web.config  (minimal) from 2.1 version.

Feb 10, 2009 at 5:29 PM
Here some info

Type : System.NullReferenceException, mscorlib, Version=, Culture=neutral, PublicKeyToken=
Message : Object reference not set to an instance of an object.
Source : Kigg.Core
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Process(System.String, Boolean, System.String, Kigg.DomainObjects.IStory)
Stack Trace :    at Kigg.Infrastructure.SpamPostprocessor.Process(String source, Boolean isSpam, String storyUrl, IStory story) in C:\CPS\#Projects\\Core\Infrastructure\Spam\SpamPostprocessor.cs:line 37
  at Kigg.Service.StoryService.<>c__DisplayClass6.<Create>b__4(String source, Boolean isSpam) in C:\CPS\#Projects\\Core\Service\StoryService.cs:line 124
  at Kigg.Infrastructure.DefaultSpamProtection.<>c__DisplayClass6.<IsSpam>b__0(String response) in C:\CPS\#Projects\\Core\Infrastructure\Spam\Default\DefaultSpamProtection.cs:line 99
  at Kigg.Infrastructure.CachingHttpForm.GetAsync(String url, Action`1 onComplete, Action`1 onError) in C:\CPS\#Projects\\Core\Infrastructure\Http\Decorated\CachingHttpForm.cs:line 65
  at Kigg.Infrastructure.DefaultSpamProtection.IsSpam(SpamCheckContent spamCheckContent, Action`2 callback) in C:\CPS\#Projects\\Core\Infrastructure\Spam\Default\DefaultSpamProtection.cs:line 81
  at Kigg.Service.StoryService.Create(IUser byUser, String url, String title, String category, String description, String tags, String userIPAddress, String userAgent, String urlReferer, NameValueCollection serverVariables, Func`2 buildDetailUrl) in C:\CPS\#Projects\\Core\Service\StoryService.cs:line 124
  at Kigg.Web.StoryController.Submit(String url, String title, String category, String description, String tags) in C:\CPS\#Projects\\Web\Controllers\StoryController.cs:line 456

Feb 10, 2009 at 11:32 PM
I'm still getting the same error as well on line 37 of SpamPostprocessor.cs.  As mentioned in the title of the post by 'non-administrative' account I mean an account that is not an administrator account that is new and logged in for the first time.   I'm running on the refresh of RC1 as well.
Feb 11, 2009 at 12:31 AM
Okay, I will check and get back to you. thanks for pointing that again.
Apr 14, 2009 at 9:13 PM
Has this been addressed yet in a release? or what is the actual fix?  I am have same problem.
Apr 14, 2009 at 11:21 PM
As I am using the RTM version with MVC v1 RTM I am not able to reproduce this exception!
I logged in with normal user, Role=User=0 and submitted a story (In Debug mode) and no exception was thrown!
I think this issue is resolved!