Bug 3835 - NSCachedUrlResponse constructor should accept null for userInfo param
Summary: NSCachedUrlResponse constructor should accept null for userInfo param
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2012-03-09 14:00 UTC by Scott Blomquist (sblom)
Modified: 2012-03-10 13:56 UTC (History)
3 users (show)

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


Attachments
The unit test (2.70 KB, application/octet-stream)
2012-03-09 17:48 UTC, Duncan Mak
Details


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:
Status:
RESOLVED FIXED

Description Scott Blomquist (sblom) 2012-03-09 14:00:33 UTC
REPRO
-----

Call: new NSCachedUrlResponse(response, data, null, NSUrlCacheStoragePolicy.NotAllowed);

OBSERVED
--------

[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Argument cannot be null.
Parameter name: userInfo
  at MonoTouch.Foundation.NSCachedUrlResponse..ctor (MonoTouch.Foundation.NSUrlResponse response, MonoTouch.Foundation.NSData data, MonoTouch.Foundation.NSDictionary userInfo, NSUrlCacheStoragePolicy storagePolicy) [0x00033] in /Developer/MonoTouch/Source/monotouch/src/Foundation/NSCachedUrlResponse.g.cs:87 

EXPECTED
--------

null should be a permitted value for the userInfo parameter according to the Apple developer docs:

https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSCachedURLResponse_Class/Reference/Reference.html#//apple_ref/occ/instm/NSCachedURLResponse/initWithResponse:data:userInfo:storagePolicy:
Comment 1 Sebastien Pouliot 2012-03-09 14:43:28 UTC
You're right. A null value is allowed. I'll fix this asap.
Thanks for the report.
Comment 2 Duncan Mak 2012-03-09 15:30:40 UTC
This has been fixed in e7bad4fb200677ef8e6eaa2c020480551bc9b50f in the master branch.

QA: Unit tests forthcoming.
Comment 3 Duncan Mak 2012-03-09 17:48:43 UTC
Created attachment 1491 [details]
The unit test
Comment 4 Sebastien Pouliot 2012-03-10 13:56:33 UTC
test committed (with a few changes) in master
fix backported to 5.2-series
thanks