diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-10 11:36:50 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-10 11:36:50 +0200 |
commit | d0bbd687ca9d33cc7bd8f53e3103ecc92905f8dc (patch) | |
tree | 626b6ab0fd7caf52aea854e110014e5e939428ca /src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt | |
parent | 274e15bbfb84a6fd9f923e56ab2055665f4fb734 (diff) | |
download | skyhanni-d0bbd687ca9d33cc7bd8f53e3103ecc92905f8dc.tar.gz skyhanni-d0bbd687ca9d33cc7bd8f53e3103ecc92905f8dc.tar.bz2 skyhanni-d0bbd687ca9d33cc7bd8f53e3103ecc92905f8dc.zip |
Fixed crash in Copy NBT data
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt index 63b8e01fb..9c56d142f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.test.command.CopyErrorCommand import net.minecraft.client.settings.KeyBinding import org.lwjgl.input.Keyboard import java.awt.Desktop @@ -28,7 +29,11 @@ object OSUtils { } fun copyToClipboard(text: String) { - Toolkit.getDefaultToolkit().systemClipboard.setContents(StringSelection(text), null) + try { + Toolkit.getDefaultToolkit().systemClipboard.setContents(StringSelection(text), null) + } catch (e: Exception) { + CopyErrorCommand.logError(e, "Error while trying to set clipboard content.") + } } fun readFromClipboard(): String? { |