Skip to content

Commit 07658f1

Browse files
committed
Fixed an error if you somehow managed to toggle the UI in the very first frame after loading in (fixes #9)
1 parent dcf537a commit 07658f1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

AddonProfiler.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ function NAP:Init()
165165
SLASH_NUMY_ADDON_PROFILER3 = '/addonprofiler';
166166
SLASH_NUMY_ADDON_PROFILER4 = '/addoncpu';
167167
SlashCmdList['NUMY_ADDON_PROFILER'] = function(message)
168+
if not self.initialized then
169+
RunNextFrame(function() SlashCmdList['NUMY_ADDON_PROFILER'](message); end);
170+
171+
return;
172+
end
168173
self:SlashCommand(message);
169174
end;
170175
RunNextFrame(function()
@@ -188,6 +193,7 @@ function NAP:Init()
188193
else
189194
self:DisableLogging();
190195
end
196+
self.initialized = true;
191197
end);
192198

193199
EventRegistry:RegisterCallback('SetItemRef', function(_, link)

0 commit comments

Comments
 (0)