diff options
author | Wuzzy <almikes@aol.com> | 2016-08-01 16:41:14 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-08-01 16:41:14 +0200 |
commit | 9b4dfb5f10826b67619e8914cb8321f35aa7b497 (patch) | |
tree | e4de4ccfffc7648abc57aa1da2cfeb11a8ad5f06 | |
parent | 97779f65a7712d2ed4ceb91e5934d1cb6f9b5686 (diff) |
get_viewed_count returns nil for unknown player
-rw-r--r-- | init.lua | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -135,6 +135,9 @@ end -- Returns how many entries have been viewed by the player function doc.get_viewed_count(playername, category_id) + if doc.data.players[playername] == nil then + return nil + end local count = doc.data.players[playername].stored_data.viewed_count[category_id] if count == nil then return 0 |