From 2f15655dceaf83d81a8e8e60ccdcc0f741781c2f Mon Sep 17 00:00:00 2001 From: Darren Liew Date: Sun, 11 May 2014 16:41:23 +0000 Subject: [PATCH] prevent uncaught error when data.title is null --- js/push.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/push.js b/js/push.js index abf7201..cb0b92a 100644 --- a/js/push.js +++ b/js/push.js @@ -458,8 +458,7 @@ } data.title = head.querySelector('title'); - var text = 'innerText' in data.title ? 'innerText' : 'textContent'; - data.title = data.title && data.title[text].trim(); + data.title = data.title && data.title['innerText' in data.title ? 'innerText' : 'textContent'].trim(); if (options.transition) { data = extendWithDom(data, '.content', body);