Added defensive coding to getNavigation.