diff options
author | the lemons <citrons@mondecitronne.com> | 2023-04-09 20:36:59 -0500 |
---|---|---|
committer | the lemons <citrons@mondecitronne.com> | 2023-04-09 20:36:59 -0500 |
commit | a9547dcdea6323650fb6c31e0d5ef2fdc01579b8 (patch) | |
tree | eb336e6ce9fdcf27149e3a1b0dbd98eaa9df2e20 | |
parent | c38a2b99de77abeb9e1adfa753a35903c8195f6f (diff) |
-rw-r--r-- | auth.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -142,8 +142,9 @@ function M.user(uid) end function M:get_data() - assert( - type(self.uid) == 'string' and self.uid:match '^%w+$', "invalid uid") + if type(self.uid) ~= 'string' or not self.uid:match '^%w+$' then + return nil + end local cached, data = cache_get('users', self.uid) if cached then return data end data = api_get('/api/user/'..self.uid) |