Opened 8 years ago

Closed 8 years ago

#369 closed defect (fixed)

Clicking "Create" without unit selected causes errors

Reported by: ibboard Owned by: ibboard
Priority: major Milestone: WarFoundry GTK 0.2
Component: WarFoundry-GUI-GTK# Version: WarFoundry 0.1
Keywords: gui unit create Cc:
Blocked By: Blocking:

Description

As reported by Cyberbooster, if you click the Create button in the New Unit dialog of the GTK# interface without selecting a unit first then you get an exception because it tries to use null as a key. This should be better handled.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Argument cannot be null.
Parameter name: key
  at System.Collections.Generic.Dictionary`2[IBBoard.WarFoundry.API.Objects.Unit,IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget].TryGetValue (IBBoard.WarFoundry.API.Objects.Unit key, IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget& value) [0x00000] in <filename unknown>:0 
  at IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.ShowUnitWidget (IBBoard.WarFoundry.API.Objects.Unit unit) [0x00000] in <filename unknown>:0 
  at IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.OnAddUnitActivated (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0 

Change History (2)

comment:1 Changed 8 years ago by ibboard

Owner: set to ibboard
Status: newaccepted

comment:2 Changed 8 years ago by IBBoard <dev@…>

Resolution: fixed
Status: acceptedclosed

In [f3453f3e4591176334aaa7f052ebb0a956f08d17/IBBoard.WarFoundry.GUI.GTK]:

Fixes #369: Clicking "Create" without unit selected causes errors

  • Disable the button from the start
Note: See TracTickets for help on using tickets.