Fix NPE in commit 3ef2ff64883ffcaa5ae36fef57aac0ae88248b24