diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/javafx/ReadWriteComposedProperty.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/javafx/ReadWriteComposedProperty.java index 9dd9246a2..60e2061f1 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/javafx/ReadWriteComposedProperty.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/javafx/ReadWriteComposedProperty.java @@ -1,6 +1,6 @@ /* * Hello Minecraft! Launcher - * Copyright (C) 2020 huangyuhui and contributors + * Copyright (C) 2021 huangyuhui and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,7 +44,11 @@ public class ReadWriteComposedProperty extends SimpleObjectProperty { this.readSource = readSource; this.writeTarget = writeTarget; - this.listener = (observable, oldValue, newValue) -> set(newValue); + this.listener = (observable, oldValue, newValue) -> { + if (!isBound()) { + set(newValue); + } + }; readSource.addListener(new WeakChangeListener<>(listener)); set(readSource.getValue()); }