In the case where an err is returned and parser is null; we should check for the existence of parser before calling it.
This is currently throwing for me:
osm-read/lib/pbfParser.js:464
parser.close();
^
TypeError: Cannot call method 'close' of undefined
at fail (osm-read/lib/pbfParser.js:464:24)
at Object.createPathParser.callback (osm-read/lib/pbfParser.js:470:24)
at osm-read/lib/pbfParser.js:409:29
at osm-read/lib/pbfParser.js:350:20
at osm-read/lib/pbfParser.js:66:28
at osm-read/lib/pbfParser.js:42:24
at bytesReadFail (osm-read/lib/nodejs/fsReader.js:5:12)
at osm-read/lib/nodejs/fsReader.js:33:20
at Object.wrapper [as oncomplete] (fs.js:454:17)
In the case where an
err
is returned andparser
isnull
; we should check for the existence ofparser
before calling it.This is currently throwing for me: