Store a copy of the given profile.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 62741e7..b70dbdb 100644 (file)
@@ -141,13 +141,15 @@ public class Sone {
        }
 
        /**
-        * Sets the profile of this Sone.
+        * Sets the profile of this Sone. A copy of the given profile is stored so
+        * that subsequent modifications of the given profile are not reflected in
+        * this Sone!
         *
         * @param profile
         *            The profile to set
         */
        public synchronized void setProfile(Profile profile) {
-               this.profile = profile;
+               this.profile = new Profile(profile);
                modificationCounter++;
        }