Object reference not set to an instance of an object.
Upgraded to a new host and umbraco 7 now the only thing broken in my events page. When you click on "Read full article" from here you will see the Object reference error. It should look like this page here. Not sure how to fix the problem any help is appreciated.
Thanks,
Tommy
we probibly need a little more detail, to help you get to the bottom of this one.
when you go to the page, the error looks like its occurring in OWBEvent.FilterEvents() this is probably code from an additional class library attached to your site. Do you have the code for this ? and can you maybe post the code for that function ?
if you do have the code, i would start by looking at places where it maybe assumes that the things it is working with are set (i.e not checking for null).
if it's old code i often end up littering the code with LogHelper.Info calls (for example:)
That write things out to the umbraco trace log (in app_data/logs) as that can help you to quickly workout what is going on inside the function. even if you just litter the function with a couple of lines saying
Hello and thank you sorry I am pretty green with this stuff. I was able to get some more detail. Turned debugging to true and now it throws this error. Thanks again,
Tommy
Line 167: var eventStart = eventNode.PropertiesAsList.Where(p => p.Alias == "startDateTime").FirstOrDefault().Value;
Bellow is a copy of the EventCalandar.ascx.xs file.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Xml.XPath;
//using DreamSongs.MongoRepository;
//using OWB.Models;
using umbraco;
using umbraco.cms.businesslogic.media;
using umbraco.cms.businesslogic.member;
using umbraco.cms.businesslogic.web;
using umbraco.cms.helpers;
using umbraco.cms.presentation;
using umbraco.NodeFactory;
public partial class usercontrols_EventsCalendar : System.Web.UI.UserControl
{
private List
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Xml.XPath;
//using DreamSongs.MongoRepository;
//using OWB.Models;
using umbraco;
using umbraco.cms.businesslogic.media;
using umbraco.cms.businesslogic.member;
using umbraco.cms.businesslogic.web;
using umbraco.cms.helpers;
using umbraco.cms.presentation;
using umbraco.NodeFactory;
public partial class usercontrols_EventsCalendar : System.Web.UI.UserControl
{
private List
Object reference not set to an instance of an object.
Upgraded to a new host and umbraco 7 now the only thing broken in my events page. When you click on "Read full article" from here you will see the Object reference error. It should look like this page here. Not sure how to fix the problem any help is appreciated. Thanks, Tommy
HI Tom,
we probibly need a little more detail, to help you get to the bottom of this one.
when you go to the page, the error looks like its occurring in
OWBEvent.FilterEvents()
this is probably code from an additional class library attached to your site. Do you have the code for this ? and can you maybe post the code for that function ?if you do have the code, i would start by looking at places where it maybe assumes that the things it is working with are set (i.e not checking for null).
if it's old code i often end up littering the code with LogHelper.Info calls (for example:)
That write things out to the umbraco trace log (in app_data/logs) as that can help you to quickly workout what is going on inside the function. even if you just litter the function with a couple of lines saying
you will be able to see where about it is breaking, as the logging will stop when the error is thrown...
Hello and thank you sorry I am pretty green with this stuff. I was able to get some more detail. Turned debugging to true and now it throws this error. Thanks again, Tommy
Line 167: var eventStart = eventNode.PropertiesAsList.Where(p => p.Alias == "startDateTime").FirstOrDefault().Value;
Bellow is a copy of the EventCalandar.ascx.xs file.
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Xml; using System.Xml.XPath; //using DreamSongs.MongoRepository; //using OWB.Models; using umbraco; using umbraco.cms.businesslogic.media; using umbraco.cms.businesslogic.member; using umbraco.cms.businesslogic.web; using umbraco.cms.helpers; using umbraco.cms.presentation; using umbraco.NodeFactory;
public partial class usercontrols_EventsCalendar : System.Web.UI.UserControl { private List
} using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Xml; using System.Xml.XPath; //using DreamSongs.MongoRepository; //using OWB.Models; using umbraco; using umbraco.cms.businesslogic.media; using umbraco.cms.businesslogic.member; using umbraco.cms.businesslogic.web; using umbraco.cms.helpers; using umbraco.cms.presentation; using umbraco.NodeFactory;
public partial class usercontrols_EventsCalendar : System.Web.UI.UserControl { private List
}
is working on a reply...