# Object Reference exception when Map hosted in a docking panel

**URL:** <https://community.thinkgeo.com/t/object-reference-exception-when-map-hosted-in-a-docking-panel/6739>\
**Category:** Silverlight\
**Created:** [July 14, 2009, 10:14am UTC](https://community.thinkgeo.com/t/object-reference-exception-when-map-hosted-in-a-docking-panel/6739 "2009-07-14T10:14:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Graeme](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/50afbb/32.png) [@Graeme](https://community.thinkgeo.com/u/Graeme)\
**Post date:** [July 14, 2009, 10:14am UTC](https://community.thinkgeo.com/t/object-reference-exception-when-map-hosted-in-a-docking-panel/6739/1 "2009-07-14T10:14:44Z")

</div>

Hi&nbsp;Guys,

We&nbsp;get&nbsp;the&nbsp;following&nbsp;exception&nbsp;whenever&nbsp;we&nbsp;try&nbsp;to&nbsp;use&nbsp;Map.Overlays.Add(layer)&nbsp;if&nbsp;the&nbsp;silverlight&nbsp;map&nbsp;component&nbsp;is&nbsp;hosted&nbsp;in&nbsp;any&nbsp;form&nbsp;of&nbsp;docking&nbsp;window&nbsp;or&nbsp;panel.&nbsp;We&nbsp;have&nbsp;tried&nbsp;both&nbsp;Telerik&nbsp;RADDocking&nbsp;and&nbsp;Divelments&nbsp;SandDock&nbsp;and&nbsp;get&nbsp;the&nbsp;same&nbsp;results.

&nbsp;"Unhandled&nbsp;Error&nbsp;in&nbsp;Silverlight&nbsp;2&nbsp;Application&nbsp;Object&nbsp;reference&nbsp;not&nbsp;set&nbsp;to&nbsp;an&nbsp;instance&nbsp;of&nbsp;an&nbsp;object.&nbsp;at&nbsp;ThinkGeo.MapSuite.SilverlightEdition.x480aa454f4d47e8f.xa1970d519f6ad4cb()\n&nbsp;at&nbsp;ThinkGeo.MapSuite.SilverlightEdition.x480aa454f4d47e8f.InsertItem(Int32&nbsp;index,&nbsp;Overlay&nbsp;item)\n&nbsp;at&nbsp;System.Collections.ObjectModel.Collection`1.Add(T&nbsp;item)\n&nbsp;at&nbsp;ThinkGeo.MapSuite.SilverlightEdition.GeoCollection`1.Add(String&nbsp;key,&nbsp;T&nbsp;item)\n&nbsp;at&nbsp;ThinkGeo.MapSuite.SilverlightEdition.GeoCollection`1.Add(T&nbsp;item)\n&nbsp;at&nbsp;Boris.Page.Page\_Loaded(Object&nbsp;sender,&nbsp;RoutedEventArgs&nbsp;e)\n&nbsp;at&nbsp;System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32&nbsp;typeIndex,&nbsp;Delegate&nbsp;handlerDelegate,&nbsp;Object&nbsp;sender,&nbsp;Object&nbsp;args)\n&nbsp;at&nbsp;MS.Internal.JoltHelper.FireEvent(IntPtr&nbsp;unmanagedObj,&nbsp;IntPtr&nbsp;unmanagedObjArgs,&nbsp;Int32&nbsp;argsTypeIndex,&nbsp;String&nbsp;eventName)"

&nbsp;

Any&nbsp;thoughts&nbsp;whether&nbsp;this&nbsp;is&nbsp;a&nbsp;fundamental&nbsp;problem&nbsp;with&nbsp;the&nbsp;map&nbsp;control&nbsp;or&nbsp;maybe&nbsp;the&nbsp;way&nbsp;in&nbsp;which&nbsp;we&nbsp;are&nbsp;using&nbsp;it?

Rgds

Graeme

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [July 14, 2009, 1:25pm UTC](https://community.thinkgeo.com/t/object-reference-exception-when-map-hosted-in-a-docking-panel/6739/2 "2009-07-14T13:25:10Z")

</div>

Graeme,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;reporting&nbsp;this&nbsp;bug&nbsp;that&nbsp;working&nbsp;with&nbsp;the&nbsp;other&nbsp;controls.&nbsp;I&nbsp;fixed&nbsp;it&nbsp;when&nbsp;I&nbsp;recreate.&nbsp;I&nbsp;think&nbsp;our&nbsp;map&nbsp;control&nbsp;becomes&nbsp;much&nbsp;more&nbsp;compatible&nbsp;in&nbsp;the&nbsp;future.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;This&nbsp;fix&nbsp;will&nbsp;be&nbsp;integrated&nbsp;in&nbsp;the&nbsp;next&nbsp;public&nbsp;release;&nbsp;If&nbsp;you&nbsp;need&nbsp;a&nbsp;temporary&nbsp;version&nbsp;which&nbsp;is&nbsp;not&nbsp;full&nbsp;tested,&nbsp;please&nbsp;ask&nbsp;[support@thinkgeo.com](mailto:support@thinkgeo.com)&nbsp;for&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;questions&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Howard
