makeContent should accept empty strings (#7764)

This commit is contained in:
Euan Caskie
2022-04-21 17:57:00 +01:00
committed by GitHub
parent 29293d7bbb
commit a1b145e0ce
2 changed files with 2 additions and 2 deletions

View File

@@ -71,7 +71,7 @@ const Messages = {
MESSAGE_BULK_DELETE_TYPE: 'The messages must be an Array, Collection, or number.',
MESSAGE_NONCE_TYPE: 'Message nonce must be an integer or a string.',
MESSAGE_CONTENT_TYPE: 'Message content must be a non-empty string.',
MESSAGE_CONTENT_TYPE: 'Message content must be a string.',
SPLIT_MAX_LEN: 'Chunk exceeds the max length and contains no split characters.',

View File

@@ -105,7 +105,7 @@ class MessagePayload {
if (this.options.content === null) {
content = '';
} else if (typeof this.options.content !== 'undefined') {
content = Util.verifyString(this.options.content, RangeError, 'MESSAGE_CONTENT_TYPE', false);
content = Util.verifyString(this.options.content, RangeError, 'MESSAGE_CONTENT_TYPE', true);
}
return content;