Skip to content

Commit

Permalink
Merge pull request #6768 from seekingalpha/less-limited-csv-import
Browse files Browse the repository at this point in the history
[FIX] CSV importer: require that there is some data in the zip, not ALL data
  • Loading branch information
engelgabriel authored Apr 24, 2017
2 parents c14d4b3 + d1e9531 commit 03b5294
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/rocketchat-importer-csv/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ Importer.CSV = class ImporterCSV extends Importer.Base {
super.updateRecord({ 'count.messages': messagesCount, 'messagesstatus': null });
super.addCountToTotal(messagesCount);

//Ensure we have some users, channels, and messages
if (tempUsers.length === 0 || tempChannels.length === 0 || messagesCount === 0) {
this.logger.warn(`The loaded users count ${ tempUsers.length }, the loaded channels ${ tempChannels.length }, and the loaded messages ${ messagesCount }`);
//Ensure we have at least a single user, channel, or message
if (tempUsers.length === 0 && tempChannels.length === 0 && messagesCount === 0) {
this.logger.error('No users, channels, or messages found in the import file.');
super.updateProgress(Importer.ProgressStep.ERROR);
return super.getProgress();
}
Expand Down

0 comments on commit 03b5294

Please sign in to comment.