From c075629cf45125ae7ef6386ce31b8db64084a57a Mon Sep 17 00:00:00 2001 From: comp500 Date: Sat, 3 Mar 2018 15:07:57 +0000 Subject: [PATCH] Fix error conditions for BaseConnectionUnix It should only throw an exception if the folder is not created. --- .../psnrigner/discordrpcjava/impl/BaseConnectionUnix.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/psnrigner/discordrpcjava/impl/BaseConnectionUnix.java b/src/main/java/com/github/psnrigner/discordrpcjava/impl/BaseConnectionUnix.java index bbf70cd..c588ce5 100644 --- a/src/main/java/com/github/psnrigner/discordrpcjava/impl/BaseConnectionUnix.java +++ b/src/main/java/com/github/psnrigner/discordrpcjava/impl/BaseConnectionUnix.java @@ -184,17 +184,17 @@ public void register(String applicationId, String command) String desktopFileName = "/discord-" + applicationId + ".desktop"; String desktopFilePath = home + "/.local"; - if (this.mkdir(desktopFilePath)) + if (!this.mkdir(desktopFilePath)) throw new RuntimeException("Failed to create directory '" + desktopFilePath + "'"); desktopFilePath += "/share"; - if (this.mkdir(desktopFilePath)) + if (!this.mkdir(desktopFilePath)) throw new RuntimeException("Failed to create directory '" + desktopFilePath + "'"); desktopFilePath += "/applications"; - if (this.mkdir(desktopFilePath)) + if (!this.mkdir(desktopFilePath)) throw new RuntimeException("Failed to create directory '" + desktopFilePath + "'"); desktopFilePath += desktopFileName;