models: handle nil query parameters gracefully for transactions

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>