Fixes that node does not crash with an invalid file handle.