fix : undefined method 'scheme' for nil:NilClass if value is nil

fix : undefined method 'scheme' for nil:NilClass if value is nil