I’d recommend this one-liner (commonly used everywhere in Gaia):
```javascript
callback = (type of callback === 'function') ? callback : function() {};
```