Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
only collect size if patch is not undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilde Ann Thurium committed Nov 1, 2018
1 parent 0772afd commit 682867c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/models/patch/file-patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export default class FilePatch {
this.oldFile = oldFile;
this.newFile = newFile;
this.patch = patch;
addEvent('file-patch-constructed', {package: 'github', sizeInBytes: this.getByteSize()});
const metricsData = {package: 'github'};
if (this.getPatch()) {
metricsData.sizeInBytes = this.getByteSize();
}

addEvent('file-patch-constructed', metricsData);
}

isPresent() {
Expand Down

0 comments on commit 682867c

Please sign in to comment.