diff --git a/patches/server/Basic-PlayerProfile-API.patch b/patches/server/Basic-PlayerProfile-API.patch index 960fb904d0..5438072b16 100644 --- a/patches/server/Basic-PlayerProfile-API.patch +++ b/patches/server/Basic-PlayerProfile-API.patch @@ -236,7 +236,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't + copyProfileProperties(this.profile, profile); + this.profile = profile; -+ } else { ++ } else if (profile != this.profile) { + copyProfileProperties(profile, this.profile); + } + } @@ -267,6 +267,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + private static void copyProfileProperties(GameProfile source, GameProfile target, boolean clearTarget) { ++ if (source == target) { ++ throw new IllegalArgumentException("Source and target profiles are the same (" + source + ")"); ++ } + PropertyMap sourceProperties = source.getProperties(); + PropertyMap targetProperties = target.getProperties(); + if (clearTarget) targetProperties.clear();