[TIMOB-9175] iOS: Blob.nativePath throws exception for non-File Blobs
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-12T04:46:09.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Release 2.1.0 |
Components | iOS |
Labels | api, module_filesystem, parity, qe-testadded |
Reporter | Arthur Evans |
Assignee | Arthur Evans |
Created | 2012-05-18T17:05:45.000+0000 |
Updated | 2013-11-08T05:33:03.000+0000 |
Description
The following code throws an exception:
var myBlob = button.toImage();
Ti.API.info("Blob.nativePath: " + JSON.stringify(myBlob.nativePath));
I would expect this to return some kind of value to indicate that nativePath is not set. Instead, it throws an exception:
[ERROR] Script Error = *** -[NSURL initFileURLWithPath:]: nil string parameter at app.js (line 28).
In this circumstance, Android returns null
, and MobileWeb returns the empty string. I believe that returning null
is the intended behavior on iOS.
*NOTE:* As part of resolving this ticket, you must update the documentation to show that the bug has been fixed. See [PR #2202](https://github.com/appcelerator/titanium_mobile/pull/2202).
Test case:
Should show nativePath returning null. On iOS, currently throws the exception shown above.
Addressed in PR: https://github.com/appcelerator/titanium_mobile/pull/2239
Closing issue Tested with Ti Studio build 2.1.0.201206141932 Ti Mobile SDK 2.1.0.v20120614194151 hash rad27673d OSX Lion 10.7.3 iPhone 4S OS 5.1 Verified that the blob returned null
Reopening to update labels.