From b86939d2228ee352bf2b3218677c4c3f4ce540a1 Mon Sep 17 00:00:00 2001 From: SpoilerRules Date: Mon, 1 Apr 2024 18:53:37 +0200 Subject: [PATCH] refactored code --- .../generator/gui/StylesheetVisualizationManager.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/spoiligaming/generator/gui/StylesheetVisualizationManager.kt b/src/main/kotlin/com/spoiligaming/generator/gui/StylesheetVisualizationManager.kt index 8144c8b..f5d5095 100644 --- a/src/main/kotlin/com/spoiligaming/generator/gui/StylesheetVisualizationManager.kt +++ b/src/main/kotlin/com/spoiligaming/generator/gui/StylesheetVisualizationManager.kt @@ -37,10 +37,8 @@ class StylesheetVisualizationManager { } private fun getTempStylesheets(element: Stylesheet): File { - if (newStylesheetResource.isEmpty()) { - throw IllegalArgumentException( - "No modified stylesheets found for element ${element.fileName}. Please contact your developer for assistance.", - ) + require(newStylesheetResource.isNotEmpty()) { + "No modified stylesheets found for element ${element.fileName}. Please contact your developer for assistance." } val tempFile = File(System.getProperty("java.io.tmpdir"), "${element.fileName}.css")