Closed
Bug 780805
Opened 12 years ago
Closed 9 years ago
Passing a null value into the first parameter of mozGetUserMedia - NS_ERROR_INVALID_POINTER is thrown, instead of a graceful failure
Categories
(Core :: WebRTC, defect, P4)
Core
WebRTC
Tracking
()
RESOLVED
DUPLICATE
of bug 1161433
backlog | webrtc/webaudio+ |
People
(Reporter: jsmith, Unassigned)
Details
JS: function successStream(stream) { alert("Success: " + stream); } function failStream(err) { alert("Failure: " + err); } function main() { navigator.mozGetUserMedia(null, successStream, failStream); } Expected: We should handle this gracefully when a null value is passed into the first parameter without dumping a nasty error in the error console. Actual: Nasty failure is seen in the error logs: Timestamp: 8/6/2012 8:10:24 PM Error: NS_ERROR_INVALID_POINTER: Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNavigatorUserMedia.mozGetUserMedia] Source File: file:///C:/Users/jsmith/Documents/Camera%20API/Simple%20Scratchpad.html Line: 16 We should really try to handle this gracefully.
Reporter | ||
Updated•12 years ago
|
Whiteboard: [getUserMedia], [blocking-gum+]
Reporter | ||
Updated•12 years ago
|
Whiteboard: [getUserMedia], [blocking-gum+] → [getUserMedia], [blocking-gum-]
Reporter | ||
Comment 1•12 years ago
|
||
I'm closing this as invalid as apparently this is normal behavior for most DOM APIs upon further investigation.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Comment 2•12 years ago
|
||
getUserMedia(null, ...) shouldn't throw because the first argument of getUserMedia is nullable. http://dev.w3.org/2011/webrtc/editor/getusermedia.html#navigatorusermedia But this WebIDL definition is invalid because dictionary types cannot be nullable. http://dev.w3.org/2006/webapi/WebIDL/#dfn-nullable-type That said, a dictionary argument will accept null value even if it is not nullable. http://dev.w3.org/2006/webapi/WebIDL/#es-dictionary In conclusion, the spec should change |MediaStreamConstraints? constraints| to |MediaStreamConstraints constraints| and we should handle the null argument gracefully.
Reporter | ||
Comment 3•12 years ago
|
||
Fair enough, I'll reopen to track then.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Reporter | ||
Updated•11 years ago
|
Blocks: webrtc-tests
Reporter | ||
Updated•11 years ago
|
No longer blocks: webrtc-tests
Comment 4•9 years ago
|
||
Are we correct per spec currently?
backlog: --- → webRTC+
Rank: 45
Flags: needinfo?(jib)
Priority: -- → P4
QA Contact: jsmith
Whiteboard: [getUserMedia], [blocking-gum-]
Comment 5•9 years ago
|
||
Yes.
Status: REOPENED → RESOLVED
Closed: 12 years ago → 9 years ago
Flags: needinfo?(jib)
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•