I'm expriencing this error when trying to submit a new post :
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
its not happening everytime which makes it even more weird, and when i debug it, i can see that it falls at this lines in the - public static string NewForumPost(string topicId) method:
var subscriberIds = forumTopic.SubscriberIds;
if (loggedInMember.Id == forumPost.Owner.MemberId)
{
subscriberIds.Remove(loggedInMember.Id);
}
Error on creating new post
Hi guys,
I'm expriencing this error when trying to submit a new post :
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
its not happening everytime which makes it even more weird, and when i debug it, i can see that it falls at this lines in the - public static string NewForumPost(string topicId) method:
var subscriberIds = forumTopic.SubscriberIds;
if (loggedInMember.Id == forumPost.Owner.MemberId) { subscriberIds.Remove(loggedInMember.Id); }
subscriberIds is null it this case
would love to get some help :)
thanks a lot!
found the answer!
in the NewForumPost(string topicId) method, there isnt any checking if the subscriberIds variable is returned NULL
in that case if there are no subscribers this topic anyone who will submit a post will get an error
you should change thease lines
if (loggedInMember.Id == forumPost.Owner.MemberId) => if (subscriberIds != null && loggedInMember.Id == forumPost.Owner.MemberId)
if (subscriberIds.Count > 0) => if (subscriberIds != null && subscriberIds.Count > 0)
hope this will help
cheers!
is working on a reply...