Exception after using Text object and closing image

Bug #772172 reported by grofaty on 2011-04-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cameron White

Bug Description

I have installed Pinta 1.0 on Windows XP sp3.
1. Open Pinta.
2. Select Text object from tools.
3. Type in some text like: test
4. Close image <CTRL>+W.
5. Press <CTRL>+W again (it looks stupid to close a non-existing image, I have just accidently pressed this combination). Exception is displayed. Pinta does not crashes, just an exception is trown and I can still work with Pinta.

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:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Core\Managers\WorkspaceManager.cs:line 51
   at Pinta.Tools.TextTool.RedrawText(Boolean showCursor, Boolean useToolLayer) in C:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Tools\TextTool\TextTool.cs:line 652
   at Pinta.Tools.TextTool.OnKeyDown(DrawingArea canvas, KeyPressEventArgs args) in C:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Tools\TextTool\TextTool.cs:line 580
   at Pinta.Core.BaseTool.DoKeyPress(DrawingArea canvas, KeyPressEventArgs args) in c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Core\Classes\BaseTool.cs:line 123
   at Pinta.Gui.Widgets.PintaCanvas.PintaCanvas_KeyPressEvent(Object o, KeyPressEventArgs e) in c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Gui.Widgets\Widgets\Canvas\PintaCanvas.cs:line 238
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle 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)

Changed in pinta:
assignee: nobody → Cameron White (cameronwhite91)
importance: Undecided → Low
Cameron White (cameronwhite91) wrote :

Fixed: https://github.com/PintaProject/Pinta/commit/479dcef02f3306ba44920e0c6239515da1a4c6ed

Just had to ensure that the text tool's work was committed (i.e. exited the editing mode) before closing the document

Changed in pinta:
status: New → Fix Committed
grofaty (grofaty) wrote :

Tested Pinta 1.1 on Windows XP sp3. Problem solved.

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

Other bug subscribers