diff options
author | rinpatch <rinpatch@sdf.org> | 2019-01-17 19:00:08 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-01-17 19:00:08 +0300 |
commit | 388ceb6a7de4a17d695b40152b5dcbfadc2eef84 (patch) | |
tree | 957da9614a5e16e3c245805baafb22abcde34db7 | |
parent | 3b187896847637d93db194897565599acd73a57c (diff) | |
download | pleroma-388ceb6a7de4a17d695b40152b5dcbfadc2eef84.tar.gz |
Fix the issue with get_by_nickname never being called
-rw-r--r-- | lib/pleroma/user.ex | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 180ef180c..13a476fd2 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -449,8 +449,13 @@ defmodule Pleroma.User do ap_id = Cachex.fetch!(:user_cache, key, fn _ -> user = get_by_id(id) - Cachex.put(:user_cache, "ap_id:#{user.ap_id}", user) - {:commit, user.ap_id} + + if user do + Cachex.put(:user_cache, "ap_id:#{user.ap_id}", user) + {:commit, user.ap_id} + else + {:ignore, ""} + end end) get_cached_by_ap_id(ap_id) |