From 62b7eb79efe0c2d43fcdf82ea3e24c56d82f6a3f Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Mon, 28 Oct 2024 13:26:44 +0200 Subject: [PATCH] fix(config): DO not assume that gelf config is set --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 51abed1..7b08d8c 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,7 @@ module.exports.init = function (app, done) { const component = ((app.config.gelf && app.config.gelf.component) || 'mta').toUpperCase(); - const maxSubjectLineLogLengthBytes = app.config.gelf.subjectLength || 32766 - 1; // 32766 is max gelf default, do -1 for good measure + const maxSubjectLineLogLengthBytes = (app.config.gelf && app.config.gelf.subjectLength) || 32766 - 1; // 32766 is max gelf default, do -1 for good measure const hostname = app.config.hostname || os.hostname(); const gelf =