#1222 fix(ParseRelation): Schema mismatch on empty array

Merged Diamond Lewis dplewis
Showing 1 of 3 files from the diff.

@@ -85,6 +85,9 @@
Loading
85 85
    if (!parent) {
86 86
      throw new Error('Cannot add to a Relation without a parent');
87 87
    }
88 +
    if (objects.length === 0) {
89 +
      return parent;
90 +
    }
88 91
    parent.set(this.key, change);
89 92
    this.targetClassName = change._targetClassName;
90 93
    return parent;
@@ -104,6 +107,9 @@
Loading
104 107
    if (!this.parent) {
105 108
      throw new Error('Cannot remove from a Relation without a parent');
106 109
    }
110 +
    if (objects.length === 0) {
111 +
      return;
112 +
    }
107 113
    this.parent.set(this.key, change);
108 114
    this.targetClassName = change._targetClassName;
109 115
  }

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src 0.01% 92.38%
Project Totals (54 files) 92.38%
Loading