In Slim\Routable:add($callable), check if $callable is null. If so, throw exception.
This will prevent this kind of errors:

@akrabat What's Slim's policy as far as type checking goes (for 3.x)?
I can create a PR for this but don't want to spend time on this if the burden of type checking is on the user and not on Slim.
This can be accomplished by either asserts or throwing an InvalidArgumentException or both.
See also: #2508
@RyanNerd it's on the list of todos once #2555 is merged before we release beta. We are going to type everything.
Thanks!
@RyanNerd You're right, it's an improvement and not a bug.
@l0gicgate Great!
Have a nice day!
@l0gicgate it appears that #2555 is for Slim 4.x -- What about 3.x?
It appears that 3.x has some manual type checking -- for example here:
https://github.com/slimphp/Slim/blob/e97d122a37b854485f39e42b23a72ec245cd276c/Slim/Http/Uri.php#L142
This is why I was asking about the policy for 3.x -- _How much manual type checking should there be in 3.x_?
In other words should Slim\Routable::add($callable) be manually type checked? If the answer is yes then this begs the question of where else should manual type checking exist? (see #2508)
This may need discussion on the Slack channel.
My bad @RyanNerd I thought this was a 4.x issue. I don鈥檛 have the answers unfortunately.
In general, if you do something wrong that results in a runtime error that clearly shows what's wrong, then I think Slim is doing the right thing.
i.e. I wouldn't object to an exception message that explains that you've passed a null in, but I'd prefer it to not cost execution time if you don't make the mistake.
@akrabat I was just thinking that assert() could be used but I think that PHP versions prior to 7 have a cost associated with them.
This is a feature that will be included in 4.x so probably best to close this issue as _will-not-fix_ since the next version of Slim is slated to have this feature baked-in.
Most helpful comment
In general, if you do something wrong that results in a runtime error that clearly shows what's wrong, then I think Slim is doing the right thing.
i.e. I wouldn't object to an exception message that explains that you've passed a null in, but I'd prefer it to not cost execution time if you don't make the mistake.