`doc.references ?= {}` might also work?