Bug 4906 - Exception i nQLPreviewControllerDelegate.FrameForPreviewItem
Summary: Exception i nQLPreviewControllerDelegate.FrameForPreviewItem
Status: RESOLVED DUPLICATE of bug 4792
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.2
Hardware: Macintosh Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-05-06 02:35 UTC by René Ruppert
Modified: 2012-05-07 03:35 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description René Ruppert 2012-05-06 02:35:16 UTC
MT 5.2.11, RELEASE BUILD, iPad 2, iOS 5.1

I have seen this execption a couple of times now while using QLPreviewController:

System.Exception: Exception of type 'System.Exception' was thrown.
  at MonoTouch.QuickLook.QLPreviewController+_QLPreviewControllerDelegate.FrameForPreviewItem (MonoTouch.QuickLook.QLPreviewItem item, MonoTouch.UIKit.UIView view) [0x00000] in <filename unknown>:0 
  at MonoTouch.UIKit.UIViewController.PresentModalViewController (MonoTouch.UIKit.UIViewController modalViewController, Boolean animated) [0x00000] in <filename unknown>:0 
  at BrainloopMobile.PreviewHelpers+<PreviewLocalDMO>c__AnonStorey21.<>m__50 (PROGRESS_STATUS eStatus) [0x00000] in <filename unknown>:0 
  at BrainloopMobile.ProgressController+<DoWork>c__AnonStorey2B.<>m__65 () [0x00000] in <filename unknown>:0 
  at MonoTouch.Foundation.NSActionDispatcher.Apply () [0x00000] in <filename unknown>:0 
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0 
  at BrainloopMobile.Application.Main (System.String[] args) [0x00000] in <filename unknown>:0 

Googling revealed this commit Rolf made:

Are the two related? Is the crash caused by a NULL rect which is now already fixed to be an empty one?
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-05-07 03:35:14 UTC
Yes, my commit is the fix for this issue.

The problem is that a RectangleF can't be null since it's a struct, so the binding generator will just make the code throw an exception instead of trying to return null (which won't compile).

A workaround is described here: https://bugzilla.xamarin.com/show_bug.cgi?id=4792#c4

*** This bug has been marked as a duplicate of bug 4792 ***