Initialize schema version upon import
This commit is contained in:
parent
cfad983d08
commit
9dcb64b53c
1 changed files with 5 additions and 3 deletions
|
@ -195,11 +195,13 @@ exports.createImporter = (writeExistingAttachmentData) => {
|
|||
throw new TypeError('"writeExistingAttachmentData" must be a function');
|
||||
}
|
||||
|
||||
return async (message) => {
|
||||
if (!exports.isValid(message)) {
|
||||
throw new TypeError('"message" is not valid');
|
||||
return async (rawMessage) => {
|
||||
if (!exports.isValid(rawMessage)) {
|
||||
throw new TypeError('"rawMessage" is not valid');
|
||||
}
|
||||
|
||||
const message = exports.initializeSchemaVersion(rawMessage);
|
||||
|
||||
const { attachments } = message;
|
||||
const hasAttachments = attachments && attachments.length > 0;
|
||||
if (!hasAttachments) {
|
||||
|
|
Loading…
Reference in a new issue