YAFLogo

Posted by: johans - Saturday, 7 July 2012 16:06:59
I get an exception when using the Goto function in the pager. I'm using 1.9.6.2 beta [quote]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) [/quote]

Posted by: tha_watcha - Saturday, 7 July 2012 17:30:06
On the posts page or the topics Page? I can not reproduce this with the latest Revision 7fc5abe3bb46

Posted by: johans - Saturday, 7 July 2012 22:20:45
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]

Posted by: bbobb - Sunday, 8 July 2012 00:53:53
In r.5337 on my test portal it surely can be reproduced. johans has r.5343.

Posted by: johans - Sunday, 8 July 2012 00:58:00
A quick note - this bug or whatever it is, is only visible if you either are administrator, or if you have "show ip" enabled.

Posted by: bbobb - Sunday, 8 July 2012 01:02:32
Very strange. Uunfortunately, don't have time to look into it so far.

Posted by: johans - Sunday, 8 July 2012 01:05:00
I checked that earlier tonite. SELECT * FROM dbo.yaf_Message AS m WHERE 1 = 1 AND m.IP IS NULL (0 row(s) affected)

Posted by: tha_watcha - Sunday, 8 July 2012 06:33:33
Should be fixed now in 149d40f25f87

Posted by: johans - Sunday, 8 July 2012 08:55:21
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!