diff --git a/vripper-core/src/main/kotlin/me/mnlr/vripper/model/Settings.kt b/vripper-core/src/main/kotlin/me/mnlr/vripper/model/Settings.kt index cd36c87b..00a9e819 100644 --- a/vripper-core/src/main/kotlin/me/mnlr/vripper/model/Settings.kt +++ b/vripper-core/src/main/kotlin/me/mnlr/vripper/model/Settings.kt @@ -1,12 +1,12 @@ package me.mnlr.vripper.model -class Settings { - var maxEventLog: Int = 1_000 - var connectionSettings = ConnectionSettings() - var downloadSettings = DownloadSettings() - var viperSettings = ViperSettings() - var clipboardSettings = ClipboardSettings() -} +data class Settings( + var maxEventLog: Int = 1_000, + var connectionSettings: ConnectionSettings = ConnectionSettings(), + var downloadSettings: DownloadSettings = DownloadSettings(), + var viperSettings: ViperSettings = ViperSettings(), + var clipboardSettings: ClipboardSettings = ClipboardSettings() +) data class ViperSettings( var login: Boolean = false, diff --git a/vripper-core/src/main/kotlin/me/mnlr/vripper/services/XpathService.kt b/vripper-core/src/main/kotlin/me/mnlr/vripper/services/XpathService.kt index d2f52a57..225c7d7f 100644 --- a/vripper-core/src/main/kotlin/me/mnlr/vripper/services/XpathService.kt +++ b/vripper-core/src/main/kotlin/me/mnlr/vripper/services/XpathService.kt @@ -14,7 +14,12 @@ class XpathService { @Throws(XpathException::class) fun getAsNode(source: Node?, xpathExpression: String?): Node? { return try { - xpath.compile(xpathExpression).evaluate(source, XPathConstants.NODE) as Node + val value = xpath.compile(xpathExpression).evaluate(source, XPathConstants.NODE) + if(value != null) { + value as Node + } else { + null + } } catch (e: Exception) { throw XpathException(e) }