[react-packager] Don't depend on error.stack being available

This commit is contained in:
Amjad Masad 2015-04-08 14:28:44 -07:00
parent 9ea0002774
commit 3d2413a38a
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ function formatError(err, filename, source) {
function formatGenericError(err, filename) {
var msg = 'TransformError: ' + filename + ': ' + err.message;
var error = new TransformError();
var stack = err.stack.split('\n').slice(0, -1);
var stack = (err.stack || '').split('\n').slice(0, -1);
stack.push(msg);
error.stack = stack.join('\n');
error.message = msg;