Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Path must be a string. Received undefined #22

Closed
breautek opened this issue Mar 3, 2017 · 1 comment
Closed

TypeError: Path must be a string. Received undefined #22

breautek opened this issue Mar 3, 2017 · 1 comment
Assignees

Comments

@breautek
Copy link

breautek commented Mar 3, 2017

Hi all. There is an issue that prevents me from handling an error case.

Reproduction steps:

  1. Obtain a .zip file, that doesn't actually contain any shapefiles.
  2. Use ogr2ogr(pathToZipFile).exec((error, data) =>{ ... } to read said zip file.
  3. The following error is produced and uncaught.
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at Object.exports.rmParentDir (/home/totalpave/tp-server/node_modules/ogr2ogr/lib/util.js:21:57)
    at EventEmitter.Ogr2ogr._clean (/home/totalpave/tp-server/node_modules/ogr2ogr/index.js:231:10)
    at wrapUp (/home/totalpave/tp-server/node_modules/ogr2ogr/index.js:203:22)
    at /home/totalpave/tp-server/node_modules/ogr2ogr/index.js:156:20
    at /home/totalpave/tp-server/node_modules/ogr2ogr/lib/util.js:56:5
    at EventEmitter.<anonymous> (/home/totalpave/tp-server/node_modules/ogr2ogr/lib/zip.js:34:24)
    at emitNone (events.js:86:13)
    at EventEmitter.emit (events.js:185:7)
    at finish (/home/totalpave/tp-server/node_modules/ogr2ogr/node_modules/findit/index.js:107:17)
    at check (/home/totalpave/tp-server/node_modules/ogr2ogr/node_modules/findit/index.js:103:37)
    at onstat (/home/totalpave/tp-server/node_modules/ogr2ogr/node_modules/findit/index.js:184:13)
    at /home/totalpave/tp-server/node_modules/ogr2ogr/node_modules/findit/index.js:133:22
    at FSReqWrap.oncomplete (fs.js:123:15)

Other relevant information:

  • NodeJS Version 6.10.0 / NPM version 3.10.10
  • ogr2ogr GDAL 1.10.1, released 2013/08/26
  • og2ogr (node module) version 1.0.0
  • OS: Ubuntu 14.04

The callback to the .exec method is invoked, with a "No valid files found" error, as expected, but the NodeJS process then crashes due to the uncaught exception sometime later in that routine.

@wavded wavded self-assigned this Mar 6, 2017
@wavded
Copy link
Owner

wavded commented Mar 6, 2017

Fixed in 1.0.1

@wavded wavded closed this as completed Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants