Skip to content

Commit

Permalink
fixes #123 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-claw authored Sep 14, 2023
1 parent 1c239d4 commit f39c7a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
14 changes: 7 additions & 7 deletions vripper-core/src/main/kotlin/me/mnlr/vripper/model/Settings.kt
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f39c7a1

Please sign in to comment.