erdomke / InnovatorAdmin

A tool for managing Aras Innovator installations focusing on improving the import/export experience.
http://erdomke.github.io/InnovatorAdmin/
MIT License
58 stars 42 forks source link

Null pointer exception when comparing packages #171

Open rneuber1 opened 8 years ago

rneuber1 commented 8 years ago

I created two packages and tried to compare them, but it failed with this error:

System.NullReferenceException: Object reference not set to an instance of an object.
   at InnovatorAdmin.ItemReference.CompareTo(ItemReference other) in c:\Projects\tools\InnovatorAdmin\InnovatorAdmin.Api\ItemReference.cs:line 220
   at System.Collections.Generic.GenericComparer`1.Compare(T x, T y)
   at System.Linq.EnumerableSorter`2.CompareKeys(Int32 index1, Int32 index2)
   at System.Linq.EnumerableSorter`1.QuickSort(Int32[] map, Int32 left, Int32 right)
   at System.Linq.EnumerableSorter`1.QuickSort(Int32[] map, Int32 left, Int32 right)
   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at InnovatorAdmin.ListCompare.Create[T,TKey](IEnumerable`1 baseList, IEnumerable`1 compareList, Func`2 keyGetter) in c:\Projects\tools\InnovatorAdmin\InnovatorAdmin.Api\Export\ListCompare.cs:line 55
   at InnovatorAdmin.InstallItemDiff.GetDiffs(IEnumerable`1 left, IEnumerable`1 right) in c:\Projects\tools\InnovatorAdmin\InnovatorAdmin.Api\Export\InstallItemDiff.cs:line 65
   at InnovatorAdmin.InstallItemDiff.GetDiffs(InstallScript left, InstallScript right) in c:\Projects\tools\InnovatorAdmin\InnovatorAdmin.Api\Export\InstallItemDiff.cs:line 59
   at InnovatorAdmin.Controls.Compare.Configure(IWizard wizard) in c:\Projects\tools\InnovatorAdmin\InnovatorAdmin\Controls\Compare.cs:line 34
   at InnovatorAdmin.Main.GoToStep(IWizardStep step) in c:\Projects\tools\InnovatorAdmin\InnovatorAdmin\Main.cs:line 155
   at InnovatorAdmin.Controls.CompareSelect.GoNext() in c:\Projects\tools\InnovatorAdmin\InnovatorAdmin\Controls\CompareSelect.cs:line 39
   at InnovatorAdmin.Main.btnNext_Click(Object sender, EventArgs e) in c:\Projects\tools\InnovatorAdmin\InnovatorAdmin\Main.cs:line 189
rneuber1 commented 8 years ago

This happens because other.keyedName is NULL in CompareTo:

image

rneuber1 commented 8 years ago

image