Software /
code /
prosody
Diff
util/serialization.lua @ 9060:69bc3144c2b7
util.serialization: Tighten up type checks
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 29 Jul 2018 00:17:41 +0200 |
parent | 9008:ae3c52419ec1 |
child | 9341:009dad867e52 |
line wrap: on
line diff
--- a/util/serialization.lua Thu Jul 26 00:17:23 2018 +0200 +++ b/util/serialization.lua Sun Jul 29 00:17:41 2018 +0200 @@ -151,9 +151,9 @@ elseif mt then tag = mt.__type; end - if fr then + if type(fr) == "function" then t = fr(t); - if tag then + if type(tag) == "string" then o[l], l = tag, l + 1; end end