return "" instead of nil
This commit is contained in:
@@ -16,6 +16,6 @@ class ConfirmingSyncPatternState < StatePattern::State
|
||||
end
|
||||
|
||||
# return the rest
|
||||
return bytes[idx+1..-1]
|
||||
return bytes[idx+1..-1] || ""
|
||||
end
|
||||
end
|
||||
@@ -23,7 +23,7 @@ class InSyncState < StatePattern::State
|
||||
# p "##################"
|
||||
reading = handle_frame(frame_lines)
|
||||
p reading
|
||||
return bytes[idx+sync_pattern_length..-1]
|
||||
return bytes[idx+sync_pattern_length..-1] || ""
|
||||
else
|
||||
return bytes
|
||||
end
|
||||
|
||||
@@ -8,6 +8,6 @@ class SearchingForSyncState < StatePattern::State
|
||||
transition_to(ConfirmingSyncPatternState)
|
||||
|
||||
# return
|
||||
return bytes[idx..-1]
|
||||
return bytes[idx..-1] || ""
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user