[beam] fix NullPointerException