Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
changed check for childnodes of body
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Ruehle committed Apr 24, 2018
1 parent 574871a commit 5ad951e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ts/util/check-if-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ function allTextNodes(nodes) {

function getPreWithSource() {
var childNodes = document.body.childNodes;
var preNode = childNodes[0];

if (childNodes.length === 1 && preNode.nodeName === "PRE") {
return preNode;
if (childNodes.length === 1 && childNodes[0].nodeName === "PRE") {
return childNodes[0];
}
return null
}
Expand Down

0 comments on commit 5ad951e

Please sign in to comment.