Copying a null profile results in an empty profile.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Oct 2010 09:48:43 +0000 (11:48 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Oct 2010 09:48:43 +0000 (11:48 +0200)
src/main/java/net/pterodactylus/sone/data/Profile.java

index 242c96e..7662eda 100644 (file)
@@ -51,6 +51,9 @@ public class Profile {
         *            The profile to copy
         */
        public Profile(Profile profile) {
+               if (profile == null) {
+                       return;
+               }
                this.firstName = profile.firstName;
                this.middleName = profile.middleName;
                this.lastName = profile.lastName;