return "" instead of nil

This commit is contained in:
Aart van Halteren
2013-07-16 23:10:17 +02:00
parent 632c59580b
commit aeb5e8435b
3 changed files with 3 additions and 3 deletions

View File

@@ -16,6 +16,6 @@ class ConfirmingSyncPatternState < StatePattern::State
end end
# return the rest # return the rest
return bytes[idx+1..-1] return bytes[idx+1..-1] || ""
end end
end end

View File

@@ -23,7 +23,7 @@ class InSyncState < StatePattern::State
# p "##################" # p "##################"
reading = handle_frame(frame_lines) reading = handle_frame(frame_lines)
p reading p reading
return bytes[idx+sync_pattern_length..-1] return bytes[idx+sync_pattern_length..-1] || ""
else else
return bytes return bytes
end end

View File

@@ -8,6 +8,6 @@ class SearchingForSyncState < StatePattern::State
transition_to(ConfirmingSyncPatternState) transition_to(ConfirmingSyncPatternState)
# return # return
return bytes[idx..-1] return bytes[idx..-1] || ""
end end
end end