Skip to content

Commit

Permalink
fix parser's bug when value is nil or blank
Browse files Browse the repository at this point in the history
  • Loading branch information
汪婧泠 committed Sep 27, 2016
1 parent e62ecf2 commit 028b99c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/redis-session-store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ def load_session_from_redis(s_key)
data = {}
redis.hkeys(s_key).each do |key|
next unless key.start_with?(hashkey_prefix)
value = redis.hget(s_key, key)
value = redis.hget(s_key, key).to_s
key = key[hashkey_prefix.length..-1]
data[key] = value ? serializer.load(value) : nil
data[key] = value.size > 0 ? serializer.load(value) : nil
end
data
end
Expand Down

0 comments on commit 028b99c

Please sign in to comment.