You could just return a deferred, that way the done()
callback won't generate errors, and you can choose to resolve it or not
if(items.length > 0){
return $.ajax({
url: 'response.php?type=getDelivery',
type: 'POST',
data: {content: items}
});
}else{
var def = new $.Deferred();
def.resolve(false);
return def;
}