Removed early return in _patch since not needed (this.props is not the only property to be checked in _patch)

This commit is contained in:
alexandercerutti
2018-08-26 12:07:23 +02:00
parent 4e3fa748c1
commit 4ea50c5d95

View File

@@ -499,13 +499,11 @@ class Pass {
*/ */
_patch(passBuffer) { _patch(passBuffer) {
if (!Object.keys(this.props).length) {
return Promise.resolve(passBuffer);
}
const rgbValues = ["backgroundColor", "foregroundColor", "labelColor"];
let passFile = JSON.parse(passBuffer.toString("utf8")); let passFile = JSON.parse(passBuffer.toString("utf8"));
if (Object.keys(this.props).length) {
const rgbValues = ["backgroundColor", "foregroundColor", "labelColor"];
rgbValues.filter(v => this.props[v] && !isValidRGB(this.props[v])).forEach(v => delete this.props[v]); rgbValues.filter(v => this.props[v] && !isValidRGB(this.props[v])).forEach(v => delete this.props[v]);
if (this.shouldOverwrite) { if (this.shouldOverwrite) {
@@ -523,6 +521,7 @@ class Pass {
} }
}); });
} }
}
fieldsName.forEach(area => { fieldsName.forEach(area => {
if (this[area].fields.length) { if (this[area].fields.length) {