From 8673b17ed5359046d424731e33ebbdbd75d6dccb Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 3 Jan 2022 12:15:11 -0800 Subject: [PATCH] Cleaned up null handling. --- .idea/inspectionProfiles/Project_Default.xml | 16 +++------------- .idea/runConfigurations.xml | 10 ---------- .../net/thauvin/erik/pinboard/PinboardPoster.kt | 3 +-- 3 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 .idea/runConfigurations.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 8ff795e..562d6ca 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,8 +1,6 @@ \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt b/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt index 54b6d21..3e1e2a8 100644 --- a/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt +++ b/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt @@ -257,9 +257,8 @@ open class PinboardPoster() { val request = Request.Builder().url(httpUrl).build() val result = client.newCall(request).execute() - val response = result.body?.string() - if (response != null) { + result.body?.string()?.let { response -> if (response.contains("done")) { return true } else {