Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/18/12 22:26:00 (13 years ago)
Author:
ascheibe
Message:

#1648 fixed NullReferenceExceptions in DTOs

Location:
trunk/sources/HeuristicLab.Clients.Access/3.3/ServiceClients
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Access/3.3/ServiceClients/LightweightUser.cs

    r8042 r8044  
    3333      this.UserName = original.UserName;
    3434      this.EMail = original.EMail;
    35       this.Groups = original.Groups.Select(x => (UserGroup)x.Clone(cloner)).ToList();
    36       this.Roles = original.Roles.Select(x => (Role)x.Clone(cloner)).ToList();
     35      this.Groups = original.Groups != null ? original.Groups.Select(x => (UserGroup)x.Clone(cloner)).ToList() : null;
     36      this.Roles = original.Roles != null ? original.Roles.Select(x => (Role)x.Clone(cloner)).ToList() : null;
    3737    }
    3838
     
    4141    }
    4242
    43     public LightweightUser() { }
     43    public LightweightUser() : base() { }
    4444
    4545    public override IDeepCloneable Clone(Cloner cloner) {
     
    4848
    4949    public override string ToString() {
    50       return UserName + " (" + FullName + ")";
     50      return (UserName != null && FullName != null) ? UserName + " (" + FullName + ")" : string.Empty;
    5151    }
    5252  }
  • trunk/sources/HeuristicLab.Clients.Access/3.3/ServiceClients/Resource.cs

    r8042 r8044  
    3737    }
    3838
    39     public Resource() { }
     39    public Resource() : base() { }
    4040
    4141    public override IDeepCloneable Clone(Cloner cloner) {
  • trunk/sources/HeuristicLab.Clients.Access/3.3/ServiceClients/Role.cs

    r8042 r8044  
    3535    }
    3636
    37     public Role() { }
     37    public Role() : base() { }
    3838
    3939    public override IDeepCloneable Clone(Cloner cloner) {
     
    4242
    4343    public override string ToString() {
    44       return Name;
     44      return Name != null ? Name : string.Empty;
    4545    }
    4646
    4747    public override bool Equals(object obj) {
    48       return ((Role)obj).Name.Equals(this.Name);
     48      return Name != null ? ((Role)obj).Name.Equals(this.Name) : false;
    4949    }
    5050
    5151    public override int GetHashCode() {
    52       return Name.GetHashCode();
     52      return Name != null ? Name.GetHashCode() : string.Empty.GetHashCode();
    5353    }
    5454  }
  • trunk/sources/HeuristicLab.Clients.Access/3.3/ServiceClients/UserGroup.cs

    r8042 r8044  
    3737    }
    3838
    39     public UserGroup() {
     39    public UserGroup()
     40      : base() {
    4041      this.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(UserGroup_PropertyChanged);
    4142    }
  • trunk/sources/HeuristicLab.Clients.Access/3.3/ServiceClients/UserGroupBase.cs

    r8042 r8044  
    2828    protected UserGroupBase(UserGroupBase original, Cloner cloner)
    2929      : base(original, cloner) {
    30       Id = original.Id;
     30      this.Id = original.Id;
    3131    }
    3232
    33     public UserGroupBase() { }
     33    public UserGroupBase() : base() { }
    3434
    3535    public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset for help on using the changeset viewer.