Minor fix

This commit is contained in:
sapics 2018-09-29 12:29:12 +09:00
parent d55249919e
commit eb740c2452

View file

@ -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 ? module.parent.parent : null,
var parent = module.parent && module.parent.parent,
requireName = parent && path.basename(path.dirname(parent.filename));
requireName = /^paper/.test(requireName) ? requireName : 'paper';