From 19764718e5a372c0a3029229e898344241979f50 Mon Sep 17 00:00:00 2001 From: Andrew Kwon Date: Thu, 18 Mar 2021 22:04:20 -0700 Subject: [PATCH] Skip updates for unnamed buffers --- lua/presence/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/presence/init.lua b/lua/presence/init.lua index 64f29a3..f4f8112 100644 --- a/lua/presence/init.lua +++ b/lua/presence/init.lua @@ -515,6 +515,10 @@ Presence.update = Presence.discord_event(function(self, buffer, should_debounce) self:update_for_buffer(buffer, should_debounce) else self.get_current_buffer(function(current_buffer) + if not current_buffer or current_buffer == "" then + return self.log:debug("Current buffer not named, skipping...") + end + self:update_for_buffer(current_buffer, should_debounce) end) end