Exceptions with icons image source

Bug #339444 reported by Eyal Wiener
2
Affects Status Importance Assigned to Milestone
Mighty Box
Fix Committed
Low
Dom ODierno

Bug Description

Description:
Silent Exceptions are thrown while using MB, probably caused by the BezelListSelector WPF manifest file, where list items icon image source is asigned with a null value (probably). This happens when no icon is set for an item.

todo:
1. have default icons for items with no icon.
2. fix the code, and handle null references correctly with no exceptions

Exception:
A first chance exception of type 'System.NotSupportedException' occurred in System.dll
System.Windows.Data Error: 22 : Cannot convert '<null>' from type '<null>' to type 'System.Windows.Media.ImageSource' for 'en-US' culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: ImageSourceConverter cannot convert from (null).
   at System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
   at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'

Eyal Wiener (eyalw)
Changed in mb:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Dom ODierno (dominick-odierno) wrote :

I fixed this by creating a ValueConverter class which handles the conversion of the Uri to an ImageSource. It first tries to do a straightup conversion of the Uri to an ImageSource (just like a standard databind). if the conversion fails its backup is to extract the icon from the physical location of the file. If this fails (Item is not a FileItem) a default icon is pulled from the IconManager.

Changed in mb:
assignee: nobody → Dom ODierno (dominick-odierno)
status: Confirmed → Fix Committed
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.