Skip to content

Commit

Permalink
[FIX] phantomjs: hide error if document.body does not exists
Browse files Browse the repository at this point in the history
bzr revid: chm@openerp.com-20140325092547-ilnbqdj4rhdo0q3r
  • Loading branch information
chm@openerp.com committed Mar 25, 2014
1 parent 105c26e commit 82989d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openerp/tests/phantomtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function PhantomTest() {
self.page.evaluate(function () {
var message = ("Timeout\nhref: " + window.location.href
+ "\nreferrer: " + document.referrer
+ "\n\n" + document.body.innerHTML).replace(/[^a-z0-9\s~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "*");
+ "\n\n" + (document.body && document.body.innerHTML)).replace(/[^a-z0-9\s~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "*");
console.log('error', message);
phantom.exit(1);
});
Expand Down

0 comments on commit 82989d9

Please sign in to comment.