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.
This commit is contained in:
parent
bc69ffcd64
commit
668f6d246d
1 changed files with 4 additions and 2 deletions
|
|
@ -1035,8 +1035,10 @@ function getStatus(callback) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (var i = 0; i < statusinfo.g.length; i++) {
|
for (var i = 0; i < statusinfo.g.length; i++) {
|
||||||
if (statusinfo.g[i].n in sessions) {
|
/* fd sometimes isn't a number, presumably when the file isn't open yet. */
|
||||||
fs.fstat(sessions[statusinfo.g[i].n].record.fd, makecallback(i));
|
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 {
|
else {
|
||||||
idleset(i, null);
|
idleset(i, null);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue