I think it would be better to use if (callback) callback() where you call it, rather than creating a dummy function here.