Skip to content

Handle empty chat output better

Yorick Peterse requested to merge chatops-no-output into master

What does this MR do?

If the output was empty we would end up running ''.split("\n"),
producing an empty Array. Slicing an empty Array using a range such as
1..-1 would then produce a nil value, instead of an empty Array. This in turn would cause a NoMethodError since "join" is not defined for
NilClass.

Example:

[][1..-1] # => nil
['foo'][1..-1] # => []

Does this MR meet the acceptance criteria?

Edited by Kamil Trzciński

Merge request reports