From e9ba56c0a1a1cc9fbd443297dddf58559c782789 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sat, 6 Jul 2019 23:55:56 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20refactor=20`#newInoNumber?= =?UTF-8?q?`=20to=20be=20compatible=20w/=20`strictNullChecks`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/volume.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/volume.ts b/src/volume.ts index 9733311a..88259204 100644 --- a/src/volume.ts +++ b/src/volume.ts @@ -647,7 +647,9 @@ export class Volume { } private newInoNumber(): number { - if (this.releasedInos.length) return this.releasedInos.pop(); + const releasedFd = this.releasedInos.pop(); + + if (releasedFd) return releasedFd; else { this.ino = (this.ino + 1) % 0xffffffff; return this.ino;