Skip to content

Commit

Permalink
Fix for issue reduxjs#83 - JSONObjectNode#getChildNodes: Cannot read …
Browse files Browse the repository at this point in the history
…property '...' of null (previousData)
  • Loading branch information
josebalius committed Aug 23, 2015
1 parent 4670a82 commit b5a878d
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 b5a878d

Please # to comment.