Crash on wrong file using Palette Tool

Bug #1890450 reported by grofaty
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
Medium
Unassigned

Bug Description

Pinta 1.7 on Ubuntu 18.04:

1. Menu Edit | Palette | Open.
2. Select "All files" at the bottom right.
3. Select PNG file (which is obviously not palette file). Crash appears:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Pinta.Core.PaletteFormats.GetLoaderByFilename (System.String fileName) [0x00040] in <e7d0dcd7669a474795360fb5061850db>:0
  at Pinta.Core.Palette.Load (System.String fileName) [0x0000b] in <e7d0dcd7669a474795360fb5061850db>:0
  at Pinta.Core.EditActions.HandlerPintaCoreActionsEditLoadPaletteActivated (System.Object sender, System.EventArgs e) [0x00174] in <e7d0dcd7669a474795360fb5061850db>:0
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <a17fa1457c5d44f2885ac746c1764ea5>:0
   --- End of inner exception stack trace ---
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x0007d] in <ed39f21b9e9343dcbd442a17ad356a9f>:0
  at GLib.Signal+SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x0000c] in <ed39f21b9e9343dcbd442a17ad356a9f>:0
  at GLib.Signal+SignalClosure.MarshalCallback (System.IntPtr raw_closure, GLib.Value* return_val, System.UInt32 n_param_vals, GLib.Value* param_values, System.IntPtr invocation_hint, System.IntPtr marshal_data) [0x00050] in <ed39f21b9e9343dcbd442a17ad356a9f>:0

Tags: easy-to-fix
Revision history for this message
Cameron White (cameronwhite91) wrote :

Confirmed, there should be better error handling for this.

Changed in pinta:
importance: Undecided → Medium
milestone: none → 1.8
status: New → Triaged
tags: added: easy-to-fix
Revision history for this message
Nick (thekolian1996) wrote :

I created a pull request.

Nick (thekolian1996)
Changed in pinta:
status: Triaged → Fix Committed
Revision history for this message
Nick (thekolian1996) wrote :
Changed in pinta:
milestone: 1.8 → 1.7.1
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.