Updated to check for nil config