fix npe when using partition clause with null