Merge pull request #84 from josebalius/master

Fix for issue #83 - JSONObjectNode#getChildNodes: Cannot read propert…
This commit is contained in:
Dan Abramov 2015-08-24 02:56:14 +03:00
commit 92aaa5a3be
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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