From: David ‘Bombe’ Roden Date: Thu, 5 Oct 2017 19:01:43 +0000 (+0200) Subject: Declare returned Core to always be non-null X-Git-Tag: 0.9.7^2~22 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=626a2e839efe6c5c912bc6efa1a0cc6c9c8576c2;p=Sone.git Declare returned Core to always be non-null --- diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 49f1158..6401b43 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -410,6 +410,7 @@ public class WebInterface implements SessionProvider { * * @return The Sone core */ + @Nonnull public Core getCore() { return sonePlugin.core(); } diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt index 3e9eed0..932827e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt @@ -11,7 +11,7 @@ import java.net.URI */ class GetImagePage(webInterface: WebInterface): FreenetPage { - private val core = webInterface.core!! + private val core = webInterface.core override fun getPath(): String { return "getImage.html" diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt index fc59639..a1fc2de 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt @@ -47,7 +47,7 @@ open class WebPageTest(pageSupplier: (Template, WebInterface) -> SoneTemplatePag val currentSone = mock() val template = mock