Guard against nulls, which cause C# process to terminate with errors (eg in docx4j.NET PDF output)