NXP-15213: fix NPE when serializing to json a document model with null ref