Skip to content

Commit cab5cee

Browse files
committed
fix: only send patch when it has keys
1 parent ecbe1c9 commit cab5cee

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/process.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ end
342342

343343
function process.handle(msg, env)
344344
-- reset current patch
345-
Patch = { device = "patch@1.0" }
345+
Patch = {}
346346

347347
-- add reply and forward actions
348348
ao.add_message_actions(msg)
@@ -386,8 +386,11 @@ function process.handle(msg, env)
386386
end
387387

388388
-- send summarized patch
389-
ao.send(Patch)
390-
Patch = { device = "patch@1.0" }
389+
if next(Patch) ~= nil then
390+
Patch.device = "patch@1.0"
391+
ao.send(Patch)
392+
Patch = {}
393+
end
391394

392395
return ao.result()
393396
end

0 commit comments

Comments
 (0)