Fix potential NULL-dereference.