From 0b68fd1a38767d64df3d4521ee59915de22a752f Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Sat, 26 Mar 2022 09:48:17 +0100 Subject: [PATCH] chore: gracefully handle missing `ElementTemplates#createElement` --- src/append-menu/AppendMenu.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/append-menu/AppendMenu.js b/src/append-menu/AppendMenu.js index 48449a4..ce970f9 100644 --- a/src/append-menu/AppendMenu.js +++ b/src/append-menu/AppendMenu.js @@ -33,6 +33,10 @@ AppendMenu.prototype._getMatchingTemplates = function() { AppendMenu.prototype._getTemplateEntries = function(element) { + if (!('createElement' in this._elementTemplates)) { + return []; + } + const templates = this._getMatchingTemplates(); return templates.map(template => {