Prevent potential NPE in strange environments.