[pve-devel] [PATCH xtermjs 2/3] check if event is set

Dominik Csapak d.csapak at proxmox.com
Fri Apr 27 11:17:36 CEST 2018


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/www/main.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/www/main.js b/src/www/main.js
index 0b09cbf..644ef7f 100644
--- a/src/www/main.js
+++ b/src/www/main.js
@@ -271,7 +271,7 @@ function tryReconnect() {
     var time_since_started = new Date() - starttime;
     var type = getQueryParameter('console');
     if (time_since_started < 5*1000) { // 5 seconds
-	stopTerminal({});
+	stopTerminal();
 	return;
     } else if (type === 'shell') {
 	updateState(states.reconnecting, 'trying to reconnect...');
@@ -285,6 +285,7 @@ function tryReconnect() {
 }
 
 function stopTerminal(event) {
+    event = event || {};
     term.off('resize');
     term.off('data');
     clearInterval(ping);
@@ -293,6 +294,7 @@ function stopTerminal(event) {
 }
 
 function errorTerminal(event) {
+    even = event || {};
     term.off('resize');
     term.off('data');
     clearInterval(ping);
-- 
2.11.0





More information about the pve-devel mailing list