Merge "Revert "Revert "Protect against null strings in hal wrapper implementation."""