diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html
index 53d722209..487055e52 100644
--- a/apps/documenteditor/main/index.html
+++ b/apps/documenteditor/main/index.html
@@ -197,7 +197,7 @@
} else
if (check(/windows\snt/i)) {
var re = /chrome\/(\d+)/i.exec(userAgent);
- if (!!re[1] && !(re[1] > 49)) {
+ if (!!re && !!re[1] && !(re[1] > 49)) {
setTimeout(function () {
document.getElementsByTagName('body')[0].className += "winxp";
},0);
diff --git a/apps/documenteditor/main/index.html.deploy b/apps/documenteditor/main/index.html.deploy
index d80ea3fbd..5f23726b8 100644
--- a/apps/documenteditor/main/index.html.deploy
+++ b/apps/documenteditor/main/index.html.deploy
@@ -196,7 +196,7 @@
} else
if (check(/windows\snt/i)) {
var re = /chrome\/(\d+)/i.exec(userAgent);
- if (!!re[1] && !(re[1] > 49)) {
+ if (!!re && !!re[1] && !(re[1] > 49)) {
setTimeout(function () {
document.getElementsByTagName('body')[0].className += "winxp";
},0);
diff --git a/apps/presentationeditor/main/index.html.deploy b/apps/presentationeditor/main/index.html.deploy
index dc72101ad..4e47893e3 100644
--- a/apps/presentationeditor/main/index.html.deploy
+++ b/apps/presentationeditor/main/index.html.deploy
@@ -196,7 +196,7 @@
} else
if (check(/windows\snt/i)) {
var re = /chrome\/(\d+)/i.exec(userAgent);
- if (!!re[1] && !(re[1] > 49)) {
+ if (!!re && !!re[1] && !(re[1] > 49)) {
setTimeout(function () {
document.getElementsByTagName('body')[0].className += "winxp";
},0);
diff --git a/apps/spreadsheeteditor/main/index.html.deploy b/apps/spreadsheeteditor/main/index.html.deploy
index f2eb95fa6..8347c8e8b 100644
--- a/apps/spreadsheeteditor/main/index.html.deploy
+++ b/apps/spreadsheeteditor/main/index.html.deploy
@@ -195,7 +195,7 @@
} else
if (check(/windows\snt/i)) {
var re = /chrome\/(\d+)/i.exec(userAgent);
- if (!!re[1] && !(re[1] > 49)) {
+ if (!!re && !!re[1] && !(re[1] > 49)) {
setTimeout(function () {
document.getElementsByTagName('body')[0].className += "winxp";
},0);