Check if there is a current route defined before getting the action

This fixes an issue I discovered when a Laravel before filter returns a response.