fix: discard any non-int tag when converting to tr4 (#8017)

Co-authored-by: reardonia <2925104+reardonia@users.noreply.github.com>
This commit is contained in:
Yat Ho
2025-12-27 01:59:17 +08:00
committed by GitHub
parent ccba9ecd9d
commit d0bcda1623

View File

@@ -786,6 +786,10 @@ void convert_jsonrpc(tr_variant::Map& top, State const& state)
{
top.erase(TR_KEY_jsonrpc);
top.replace_key(TR_KEY_id, TR_KEY_tag);
if (auto const tag = top.find_if<int64_t>(TR_KEY_tag); state.was_jsonrpc && tag == nullptr)
{
top.erase(TR_KEY_tag);
}
}
if (state.is_response && is_legacy && state.is_success && state.was_jsonrpc)