Skip to content

Commit

Permalink
Merge pull request #6 from mgravell/master
Browse files Browse the repository at this point in the history
Fix First/FirstOrDefault (see http://stackoverflow.com/q/23109088/23354)...
  • Loading branch information
sethwebster committed Apr 16, 2014
2 parents 0326add + cffcf90 commit e01489c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ deploy/*
*.cache
packages/
artifacts/
msbuild.log
msbuild.log
*.sln.ide/
2 changes: 1 addition & 1 deletion GoogleMaps.LocationServices/GoogleLocationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public Region GetRegionFromLatLong(double latitude, double longitude)
public MapPoint GetLatLongFromAddress(string address)
{
XDocument doc = XDocument.Load(string.Format(APIUrlLatLongFromAddress, Uri.EscapeDataString(address)));
var els = doc.Descendants("result").Descendants("geometry").Descendants("location").First();
var els = doc.Descendants("result").Descendants("geometry").Descendants("location").FirstOrDefault();
if (null != els)
{
var latitude = ParseUS((els.Nodes().First() as XElement).Value);
Expand Down

0 comments on commit e01489c

Please sign in to comment.