Fixes #9104. Returning null or undefined in a pipe callback shouldn't end up throwing an exception. Silly, silly, me.

This commit is contained in:
jaubourg 2011-05-09 10:01:20 +02:00
parent efd0fce7a1
commit 8c13cfa805
2 changed files with 11 additions and 3 deletions

View file

@ -119,7 +119,7 @@ jQuery.extend({
if ( jQuery.isFunction( fn ) ) {
deferred[ handler ](function() {
returned = fn.apply( this, arguments );
if ( jQuery.isFunction( returned.promise ) ) {
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise().then( newDefer.resolve, newDefer.reject );
} else {
newDefer[ action ]( returned );