mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Merge pull request #1526 from sapics/patch1
Fix Cannot read property 'parent' of undefined in node
This commit is contained in:
commit
d55249919e
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ var path = require('path');
|
|||
// Determine the name by which name the module was required (either 'paper',
|
||||
// 'paper-jsdom' or 'paper-jsdom-canvas'), and use this to determine if error
|
||||
// exceptions should be thrown or if loading should fail silently.
|
||||
var parent = module.parent.parent,
|
||||
var parent = module.parent ? module.parent.parent : null,
|
||||
requireName = parent && path.basename(path.dirname(parent.filename));
|
||||
requireName = /^paper/.test(requireName) ? requireName : 'paper';
|
||||
|
||||
|
|
Loading…
Reference in a new issue