Four menu options from Edit menu crashes Pinta

Bug #1186785 reported by grofaty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
Medium
Cameron White

Bug Description

Pinta from master on Windows XP.
1. Close down all images.
2. Now select one of the following:
a) Edit | Deselect All
b) Edit | Delete Selection
c) Edit | Fill Selection
d) Edit | Invert Selection

All above four options crashes Pinta with the same error:
============
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Tried to get WorkspaceManager.ActiveDocument when there are no open Documents. Check HasOpenDocuments first.
   at Pinta.Core.WorkspaceManager.get_ActiveDocument() in c:\aaa\Pinta-master\Pinta.Core\Managers\WorkspaceManager.cs:line 57
   at Pinta.Core.EditActions.HandlePintaCoreActionsEditDeselectActivated(Object sender, EventArgs e) in c:\aaa\Pinta-master\Pinta.Core\Actions\EditActions.cs:line 223
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
   at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
============

I know selection this options is stupid if there is no canvas, but in my humble opinion we should have zero tolerance to crashes.

I suggest to make all above four options grayed out if there is no image opened in Pinta.

Revision history for this message
grofaty (grofaty) wrote :

The same crash appears:
1. Close down all images.
2. Click on Deselect All button from toolbar and crash with the same error appears.

Revision history for this message
Cameron White (cameronwhite91) wrote :
Changed in pinta:
assignee: nobody → Cameron White (cameronwhite91)
importance: Undecided → Medium
milestone: none → 1.5
status: New → Fix Committed
Revision history for this message
grofaty (grofaty) wrote :

Tested using latest master on Windows XP. This four menus options and button on toolbar is grayed out when no canvas exists, so the problem is fixed. Thanks.

Changed in pinta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.