From 2d57aa297b05489783c5ddb7452d074a67654748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Fri, 29 Sep 2023 01:34:08 +0200 Subject: [PATCH] fix(Presence:authorize): attempt to index local 'response' (a nil value) Co-authored-by: Taken --- lua/presence/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/presence/init.lua b/lua/presence/init.lua index 590eec0..d3dddac 100644 --- a/lua/presence/init.lua +++ b/lua/presence/init.lua @@ -357,7 +357,12 @@ function Presence:authorize(on_done) return end - self.log:info(string.format("Authorized with Discord for %s", response.data.user.username)) + if not response then + self.log:info(string.format("Authorized with Discord for %s", "Response was nil")) + else + self.log:info(string.format("Authorized with Discord for %s", response.data.user.username)) + end + self.is_authorized = true if on_done then