johans
  • Posts: 42
  • Joined: 05/06/2012
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)

Sponsor
tha_watcha
  • Posts: 4116
  • Joined: 06/03/2010
On the posts page or the topics Page? I can not reproduce this with the latest Revision 7fc5abe3bb46


UserPostedImage
johans
  • Posts: 42
  • Joined: 05/06/2012
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
  • Posts: 1558
  • Joined: 21/10/2008
In r.5337 on my test portal it surely can be reproduced. johans has r.5343.


johans
  • Posts: 42
  • Joined: 05/06/2012
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
  • Posts: 1558
  • Joined: 21/10/2008
Very strange. Uunfortunately, don't have time to look into it so far.
johans
  • Posts: 42
  • Joined: 05/06/2012
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
  • Posts: 4116
  • Joined: 06/03/2010
Should be fixed now in 149d40f25f87
UserPostedImage
johans
  • Posts: 42
  • Joined: 05/06/2012
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!
Users browsing this topic
    Forum Jump  
    • You cannot post new topics in this forum.
    • You cannot reply to topics in this forum.
    • You cannot delete your posts in this forum.
    • You cannot edit your posts in this forum.
    • You cannot create polls in this forum.
    • You cannot vote in polls in this forum.

    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button

    Project Twitter Updates

    Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved