Fix null pointer when opened offline.