YAFLogo

johans
  • johans
  • 51.8% (Neutral)
  • YAF Lover Topic Starter
12 years ago
I get an exception when using the Goto function in the pager.

I'm using 1.9.6.2 beta

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at YAF.Controls.DisplayPost.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) at System.Web.UI.Control.DataBindChildren() at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at YAF.Pages.posts.BindData() at YAF.Controls.Pager._gotoPageForm_GotoPageClick(Object sender, GotoPageForumEventArgs e) in e:\tmp\YetAnotherForum.Net.1.9.6.2.beta\yafsrc\YAF.Controls\Pager.cs: line 584 at YAF.Controls.GotoPageForm.GotoButtonClick(Object sender, EventArgs e) in e:\tmp\YetAnotherForum.Net.1.9.6.2.beta\yafsrc\YAF.Controls\GotoPageForm.cs: line 264 at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, ref Boolean completedSynchronously)

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
12 years ago
On the posts page or the topics Page? I can not reproduce this with the latest Revision 7fc5abe3bb46

johans
  • johans
  • 51.8% (Neutral)
  • YAF Lover Topic Starter
12 years ago
I tried the latest revision (35716ef1080e), but i had the same problem.

Then i attached the Yaf sourcecode and debugged. It breaks in Page_Load in DisplayPost.ascx.cs on line:

string ip = IPHelper.GetIp4Address(this.DataRow["IP"].ToString());

DataRow is null. Attached the stack trace.

BindData() in posts.ascx.cs calls LegacyDb.post_list, and it returns an amount of rows.

this.MessageList.DataSource = pagedData; is ok too, the pagedData contains the correct datarows.

20 rows below, on this.DataBind(); it says boom.

How can i continue debugging it?

> YAF.dll!YAF.Controls.DisplayPost.Page_Load(object sender, System.EventArgs e) Line 282 + 0x14 bytes C#

[External Code]

YAF.dll!YAF.Pages.posts.BindData() Line 1151 + 0xb bytes C#

YAF.dll!YAF.Pages.posts.Pager_PageChange(object sender, System.EventArgs e) Line 1509 + 0x8 bytes C#

YAF.Controls.dll!YAF.Controls.Pager._gotoPageForm_GotoPageClick(object sender, YAF.Controls.GotoPageForumEventArgs e) Line 584 + 0x2f bytes C#

YAF.Controls.dll!YAF.Controls.GotoPageForm.GotoButtonClick(object sender, System.EventArgs e) Line 264 + 0x43 bytes C#

[External Code]

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
12 years ago
In r.5337 on my test portal it surely can be reproduced. johans has r.5343.

johans
  • johans
  • 51.8% (Neutral)
  • YAF Lover Topic Starter
12 years ago
A quick note - this bug or whatever it is, is only visible if you either are administrator, or if you have "show ip" enabled.
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
12 years ago
Very strange. Uunfortunately, don't have time to look into it so far.
johans
  • johans
  • 51.8% (Neutral)
  • YAF Lover Topic Starter
12 years ago
I checked that earlier tonite.

SELECT *

FROM dbo.yaf_Message AS m

WHERE 1 = 1

AND m.IP IS NULL

(0 row(s) affected)

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
12 years ago
Should be fixed now in 149d40f25f87
johans
  • johans
  • 51.8% (Neutral)
  • YAF Lover Topic Starter
12 years ago
It is. Just applied patch and verified.

Looks like, from your patch, that the DataRow object is set later in the cycle.

Thanks a lot for the fix!