Check if currentRoute is defined.

Fix for `TypeError: Cannot read property 'originalPath' of undefined`