MarkMpn / Sql4Cds

SQL 4 CDS core engine and XrmToolbox tool
MIT License
74 stars 22 forks source link

Autocomplete NullReferenceException typing in the SET for an UPDATE #389

Closed clintonbale closed 9 months ago

clintonbale commented 10 months ago

The query below starts to throw exceptions when attempting to type in parent after child.owneridtype = ...

UPDATE child
SET    child.ownerid     = parent.ownerid,
       child.owneridtype = /* typing anything here throws exception */
FROM   account AS child
JOIN   account AS parent ON child.parentaccountid = parent.accountid
WHERE  parent.ownerid <> child.ownerid

Exception details:

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at MarkMpn.Sql4Cds.XTB.Autocomplete.GetSuggestions(String text, Int32 pos)
   at MarkMpn.Sql4Cds.XTB.SqlQueryControl.AutocompleteMenuItems.<GetEnumerator>d__2.MoveNext()
   at AutocompleteMenuNS.AutocompleteMenu.BuildAutocompleteList(Boolean forced)
   at AutocompleteMenuNS.AutocompleteMenu.ShowAutocomplete(Boolean forced)
   at AutocompleteMenuNS.AutocompleteMenu.timer_Tick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)