fix possible nullPointerException introduced in commit 16b2940