From 0448dca832d70983e2f192d770a0eaba5b47934e Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 27 Sep 2016 10:38:01 +0100 Subject: [PATCH] Fail hard & fast if linkifyjs version is wrong Rather than carrying on an ending up with undefineds deep within the bowels of linkifyjs when we try to linkify a room alias. --- src/linkify-matrix.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index 8dceb3a527..3786c944a5 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -22,6 +22,9 @@ function matrixLinkify(linkify) { var MultiToken = MT.Base; var S_START = linkify.parser.start; + if (TT.UNDERSCORE === undefined) { + throw new Error("linkify-matrix requires linkifyjs 2.1.1: this version is too old."); + } var ROOMALIAS = function(value) { MultiToken.call(this, value);