replaced the null checks with appropriate methods

also a method getParty(boolean) has been added