Skip to content

Node.js based forum software built for the modern web

fix replying on IE11 - see https://github.com/NodeBB/NodeBB/commit/c50f228accc3485fcee74e875b9316f8e65e9261#commitcomment-17651064 (#4699)

Ben Lubarc288ba0a172d
diff --git a/public/src/client/topic/postTools.js b/public/src/client/topic/postTools.js
index fa2a72e617..0195c00417 100644
--- a/public/src/client/topic/postTools.js
+++ b/public/src/client/topic/postTools.js
@@ -232,7 +232,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
var selection = window.getSelection ? window.getSelection() : document.selection.createRange();
var content = button.parents('[component="post"]').find('[component="post/content"]').get(0);
- if (content && selection.containsNode(content, true)) {
+ if (selection && selection.containsNode && content && selection.containsNode(content, true)) {
var bounds = document.createRange();
bounds.selectNodeContents(content);
var range = selection.getRangeAt(0).cloneRange();