Guard against null reference