lib/rubocop/cop/layout/hash_alignment.rb in rubocop-1.23.0 vs lib/rubocop/cop/layout/hash_alignment.rb in rubocop-1.24.0
- old
+ new
@@ -311,10 +311,10 @@
def correct_node(corrector, node, delta)
# We can't use the instance variable inside the lambda. That would
# just give each lambda the same reference and they would all get the
# last value of each. A local variable fixes the problem.
- if node.value
+ if node.value && node.respond_to?(:value_omission?) && !node.value_omission?
correct_key_value(corrector, delta, node.key.source_range,
node.value.source_range,
node.loc.operator)
else
delta_value = delta[:key] || 0