[FIX] phantomjs: hide error if document.body does not exists

bzr revid: chm@openerp.com-20140325092547-ilnbqdj4rhdo0q3r
This commit is contained in:
chm@openerp.com 2014-03-25 10:25:47 +01:00
parent 105c26e623
commit 82989d95f7
1 changed files with 1 additions and 1 deletions

View File

@ -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);
});