This is interesting. I've used a similar pattern a hundred times in my own code and what I do is just:
```javascript
if (callback) callback();
```
Meaning, if it's undefined/null it won't get call. If it's not undefined/null it just better be a function or else there's a bug in the code that needs to be addressed.