Skip to content

Commit 363df28

Browse files
committed
Loosen input type to webdriver.stacktrace.getStack_ to account
for an rare condition in FF 28+ where the Error() constructor returns undefined (not sure what causes it, just know it happens)
1 parent 71cb9e5 commit 363df28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: javascript/webdriver/stacktrace.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,14 @@ webdriver.stacktrace.parseLongFirefoxFrame_ = function(frameStr) {
562562
* V8 prepends the string representation of an error to its stack trace.
563563
* This function trims the string so that the stack trace can be parsed
564564
* consistently with the other JS engines.
565-
* @param {!(Error|goog.testing.JsUnitException)} error The error.
565+
* @param {(Error|goog.testing.JsUnitException)} error The error.
566566
* @return {string} The stack trace string.
567567
* @private
568568
*/
569569
webdriver.stacktrace.getStack_ = function(error) {
570+
if (!error) {
571+
return '';
572+
}
570573
var stack = error.stack || error.stackTrace || '';
571574
var errorStr = error + '\n';
572575
if (goog.string.startsWith(stack, errorStr)) {

0 commit comments

Comments
 (0)