Bug fix: preventing NPE when argument is null