throw exception when handling null value