Hi All,
I've got a 4.4.3 forums module that users started reporting errors for. They said that when they clicked "new thread" they would get a message saying "add/edit post is currently unavailable."
I looked into it further and determined that the culprit was here, in Forum_PostEdit.ascx.vb (starting on line 374):
For Each trackedThread In trackedThreads
If trackedThread.ThreadID = mParentPostInfo.ThreadID Then
blnTrackedThread = True
Exit For
End If
Next
The problem is that for a new thread, mParentPostInfo is going to be Nothing (null). So a NullReferenceException gets thrown when you try to inspect the ThreadId property of that object.
I fixed this by changing that block of code to the following:
For Each trackedThread In trackedThreads
' Added the outer if statement that checks for a null mParentPostInfo
' object. Otherwise we could get null reference exceptions.
If Not mParentPostInfo Is Nothing Then
If trackedThread.ThreadID = mParentPostInfo.ThreadID Then
blnTrackedThread = True
Exit For
End If
End If
Next
Is this a genuine bug or is there some other issue that's causing this problem in my installation?
-Josh