Filtering on NULL values with frappe.db.get_value?

I’m trying to add a filter to a print format that includes matching on NULL values for one column. How do I write “reference_name IS NULL” within the filtering of a frappe.db.get_value call? The query I have is as follows:

{% set party_amount = frappe.db.get_value("Journal Entry Account", {"parent": g.voucher_no, "party":, "reference_name": "IS NULL"}, "party_balance") %}

This returns an empty set at present which is not correct - there should be one result.

Resolved by removing the reference_name query and enclosing the rest in an if statement of “if g.against_voucher is none” (g is a GL Entry)