chjj/tty.js — Issue #12: Operations on a non-existent terminal crash server
Author: risacher
Created: 2012-03-09 22:14:44+00:00
State: open

Various operations on non-existent terminal cause the server to crash. I ran into this when I restarted the server, and had sessions open. Then resizing a terminal causes this:

/home/magnus/node/tty.js/lib/tty.js:177
terms[id].resize(cols, rows);
^
TypeError: Cannot call method 'resize' of undefined
at Socket. (/home/magnus/node/tty.js/lib/tty.js:177:15)
at Socket.$emit (events.js:77:17)
at SocketNamespace.handlePacket (/home/magnus/node/tty.js/node_modules/socket.io/lib/namespace.js:335:22)
at Manager.onClientMessage (/home/magnus/node/tty.js/node_modules/socket.io/lib/manager.js:462:38)
at WebSocket.onMessage (/home/magnus/node/tty.js/node_modules/socket.io/lib/transport.js:387:20)
at Parser. (/home/magnus/node/tty.js/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js:40:10)
at Parser.emit (events.js:67:17)
at /home/magnus/node/tty.js/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js:289:16
at Parser.expectHandler (/home/magnus/node/tty.js/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js:300:
15)
at Parser.add (/home/magnus/node/tty.js/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js:467:24)