Replace direct member access with getter that checks for nullness. Change-Id: I4a56a0ee903ae7d8c89b91d74b128302e1965586