Go4Expert (http://www.go4expert.com/)
-   Meet and Greet (http://www.go4expert.com/community/meet-and-greet/)
-   -   NullReferenceException Was Unhandled c# (http://www.go4expert.com/community/nullreferenceexception-unhandled-c-sharp-t22013/)

tookerello 5May2010 22:36

NullReferenceException Was Unhandled c#
Hi could somebody please help me with this as i have been trying to fix it for hours!!!
I keep receving the "NullReferenceException was unhandled " message in the bold line

public static Conditions GetCurrentConditions(string location)
Conditions c;
c = null;
c = new Conditions();


XmlDocument xmlConditions = new XmlDocument();
if (xmlConditions.SelectSingleNode("xml_api_reply/weather/problem_cause") != null)
c = null;
Conditions cond = new Conditions();
cond.Town = xmlConditions.SelectSingleNode("/xml_api_reply/weather/forecast_information/city").Attributes["data"].InnerText;

return c;

All times are GMT +5.5. The time now is 22:41.