Fix if Collection Instance = null, so for Example XAML of a Window with ContextMenu can be parsed!
A Resource Dictionary can not only contain Objects wich a Key or Styles.
For Example a DataTemplate may be in the ResourceDictionary and has no Key set and is no Style.