Prevents exceptions related to invalid routeIds.