BRANCH 4.2-DEV: added minor encoding check for null