These can be unset for various reasons. Add null checks in appropriate places. closes #1842 Change-Id: Ib428e87775f8b45192aa901f6788ca526578b261 (cherry picked from commit 666fbc3dcf)
666fbc3dcf