Handle empty chat output better
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?
-
Tests added for this feature/bug - Review
-
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
Edited by Kamil Trzciński