Skip to content

Commit

Permalink
Merge pull request #84 from josebalius/master
Browse files Browse the repository at this point in the history
Fix for issue #83 - JSONObjectNode#getChildNodes: Cannot read propert…
  • Loading branch information
gaearon committed Aug 23, 2015
2 parents 4670a82 + b5a878d commit 92aaa5a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/react/JSONTree/JSONArrayNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class JSONArrayNode extends React.Component {
let childNodes = [];
this.props.data.forEach((element, idx) => {
let prevData;
if (typeof this.props.previousData !== 'undefined') {
if (typeof this.props.previousData !== 'undefined' && this.props.previousData !== null) {
prevData = this.props.previousData[idx];
}
const node = grabNode(idx, element, prevData, this.props.theme);
Expand Down
2 changes: 1 addition & 1 deletion src/react/JSONTree/JSONIterableNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class JSONIterableNode extends React.Component {
}

let prevData;
if (typeof this.props.previousData !== 'undefined') {
if (typeof this.props.previousData !== 'undefined' && this.props.previousData !== null) {
prevData = this.props.previousData[key];
}
const node = grabNode(key, value, prevData, this.props.theme);
Expand Down
2 changes: 1 addition & 1 deletion src/react/JSONTree/JSONObjectNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class JSONObjectNode extends React.Component {
for (let k in obj) {
if (obj.hasOwnProperty(k)) {
let prevData;
if (typeof this.props.previousData !== 'undefined') {
if (typeof this.props.previousData !== 'undefined' && this.props.previousData !== null) {
prevData = this.props.previousData[k];
}
const node = grabNode(k, obj[k], prevData, this.props.theme);
Expand Down

0 comments on commit 92aaa5a

Please sign in to comment.