From cf2e8b8ef23fb0a361a394f0c82ea1b7eaedb92e Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sun, 12 Apr 2020 17:56:14 +0200 Subject: [PATCH] Set undefined buffer.type as other --- js/models.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/models.js b/js/models.js index 1473fd4..b1ae9f2 100644 --- a/js/models.js +++ b/js/models.js @@ -90,7 +90,13 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo // There are two kinds of types: bufferType (free vs formatted) and // the kind of type that distinguishes queries from channels etc var bufferType = message.type; + + // If type is undefined set it as other to avoid later errors var type = message.local_variables.type; + if (!type) { + type = 'other'; + } + var indent = (['channel', 'private'].indexOf(type) >= 0); var plugin = message.local_variables.plugin;