From 97fe86c91685dae39786a09796a24f7c90645c9a Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Thu, 19 Jan 2017 12:13:23 -0700
Subject: [PATCH] Fix wrapper breaking when no attrs need replaced
---
public/vendor/bootbox/wrapper.js | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/public/vendor/bootbox/wrapper.js b/public/vendor/bootbox/wrapper.js
index 429fa9d6c6..505b42788f 100644
--- a/public/vendor/bootbox/wrapper.js
+++ b/public/vendor/bootbox/wrapper.js
@@ -52,12 +52,16 @@ require(['translator'], function (shim) {
]).then(function (ref) {
var translated = ref[0];
var translatedAttrs = ref[1];
- translated.split(' || ').forEach(function (html, i) {
- $(nodes[i]).replaceWith(html);
- });
- translatedAttrs.split(' || ').forEach(function (text, i) {
- attrNodes[i][1].setAttribute(attrNodes[i][0], text);
- });
+ if (translated) {
+ translated.split(' || ').forEach(function (html, i) {
+ $(nodes[i]).replaceWith(html);
+ });
+ }
+ if (translatedAttrs) {
+ translatedAttrs.split(' || ').forEach(function (text, i) {
+ attrNodes[i][1].setAttribute(attrNodes[i][0], text);
+ });
+ }
if (show) {
$elem.modal('show');
}