Fix NRE when saving Poco with null references