3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00

cases: don't break if a case note is an empty string

This commit is contained in:
Dragory 2020-07-30 01:45:32 +03:00
parent ae97a5dded
commit 0a4b4147c6
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -52,7 +52,12 @@ export async function getCaseEmbed(
if (theCase.notes.length) {
theCase.notes.forEach((note: any) => {
const noteDate = moment(note.created_at);
const chunks = chunkMessageLines(note.body, 1014);
let noteBody = note.body.trim();
if (noteBody === "") {
noteBody = emptyEmbedValue;
}
const chunks = chunkMessageLines(noteBody, 1014);
for (let i = 0; i < chunks.length; i++) {
if (i === 0) {