HIVE-8852: fix NPE