cujojs/when — pull request #412 by Feasul (2014-12-10 15:55:02+00:00)
Title: Fix unhandled rejection reporting for null errors

In case promise is rejected with a 'null' and unhadled rejection is reported check for error type fails in 'formatError' method. The reason for it is that 'typeof null' is also an 'object' (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof).

Therefore an additional check for 'e' to also not be a 'null' is added to 'formatError' method code.