Fix a potential NULL dereference.