Closes #3425853. Prevent PHP notice if current route's routename is NULL by explicitly checking for NULL.