Modified null check code in dynamic nav.