Skip to content

Commit b4e4d40

Browse files
authored
Fix for #39 - adding checks before processing (#40)
Adding checks before processing to avoid errors in logs.
1 parent dedba82 commit b4e4d40

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

prs-core.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ local function get_dropped_and_added_affects(old_affects, new_affects)
7878
end
7979

8080
function core.on_gmcp_char(event, args)
81+
if not gmcp.Char.State then return end
82+
if not gmcp.Char.State.update then return end
83+
8184
local diff_table = gmcp.Char.State.update
8285

8386
local dropped = {}
@@ -102,6 +105,9 @@ function core.on_gmcp_char(event, args)
102105
end
103106

104107
function core.on_gmcp_char_state(event, args)
108+
if not gmcp.Char.State then return end
109+
if not gmcp.Char.State.update then return end
110+
105111
local diff_table = gmcp.Char.State.update
106112

107113
local dropped = {}
@@ -140,4 +146,4 @@ function core.stop()
140146
end
141147
end
142148

143-
core.initialize()
149+
core.initialize()

0 commit comments

Comments
 (0)