1
Vote

Crash when removing server from settings list

description

Relevant stack trace:

System.Configuration.ConfigurationErrorsException was unhandled
HResult=-2146232062
Message=Index -1 is out of range.
Source=System.Configuration
BareMessage=Index -1 is out of range.
Line=0
StackTrace:
   at System.Configuration.ConfigurationElementCollection.BaseRemoveAt(Int32 index)
   at Floe.Configuration.ServerElementCollection.RemoveAt(Int32 index)
   at Floe.UI.Settings.ServerSettingsControl.btnDelete_Click(Object sender, RoutedEventArgs e)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
---snip---

Steps to reproduce:
  1. Open Settings, navigate to Servers tab.
  2. Click 'Add'
  3. Click 'Remove'
  4. Click 'Add' again
  5. Click 'Remove' again -- crash.
Looks like the indexes of the items in the list control aren't being tracked properly.

comments