NXP-11397: avoid NPE on error logging