Fix potential NULL dereference warning.