# HG changeset patch # User John "Elwin" Edwards # Date 1389017495 18000 # Node ID bac9c3b016924c01966fa1b974837dbb907e8e40 # Parent 8d6bf19d82272aa8913e3a50d95e54783700080e Check that the ttyrec stream has an fd before passing it to fstat. The stream might not have an fd, presumably if the open isn't complete. Calling fstat then causes crashes. diff -r 8d6bf19d8227 -r bac9c3b01692 rlgwebd.js --- a/rlgwebd.js Wed Jan 01 14:13:10 2014 -0500 +++ b/rlgwebd.js Mon Jan 06 09:11:35 2014 -0500 @@ -1035,8 +1035,10 @@ } } for (var i = 0; i < statusinfo.g.length; i++) { - if (statusinfo.g[i].n in sessions) { - fs.fstat(sessions[statusinfo.g[i].n].record.fd, makecallback(i)); + /* fd sometimes isn't a number, presumably when the file isn't open yet. */ + var ssid = statusinfo.g[i].n; + if (ssid in sessions && typeof(sessions[ssid].record.fd) == 'number') { + fs.fstat(sessions[ssid].record.fd, makecallback(i)); } else { idleset(i, null);