title: Double value in Dictionary
body: <p>I have this code to get two double from jSon:</p>
  
  <pre><code>Dictionary&lt;string, object&gt; dict = this.GetDicFromInput();
  Decimal tmpLat = (Decimal)dict["lat"];
  Decimal tmpLon = (Decimal)dict["lon"];
  </code></pre>
  
  <p>This is <code>GetDicFromInput</code>:</p>
  
  <pre><code>private Dictionary&lt;string, object&gt; GetDicFromInput()
  {
      string input = null;
  
      input = "{\"lon\":34.806109,\"lat\":31.9599733}";
  
      var json = new JavaScriptSerializer() { MaxJsonLength = int.MaxValue };
      Dictionary&lt;string, object&gt; dict = (Dictionary&lt;string, object&gt;)json.DeserializeObject(input);
  
      return dict;
  }
  </code></pre>
  
  <p>And when I run it I get:</p>
  
  <pre><code> [NullReferenceException: Object reference not set to an instance of an object.]
     BabySitter.Search.Page_Load(Object sender, EventArgs e) in \\psf\home\Documents\Visual Studio 2010\Projects\BabySitter\BabySitter\Search.aspx.cs:28
     System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
     System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
     System.Web.UI.Control.OnLoad(EventArgs e) +91
     System.Web.UI.Control.LoadRecursive() +74
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
  </code></pre>
  
  <p>This is the fail line:</p>
  
  <pre><code>Decimal tmpLat = (Decimal)dict["lat"];
  </code></pre>