BUG-1434: fix NPEs when using null byte arrays