Skip to content

Commit

Permalink
Fixed github workflow check errors
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Au <[email protected]>
  • Loading branch information
Joshua152 committed Nov 8, 2023
1 parent 73af3b7 commit 871952c
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ data class ExplainFilter(

@Throws(IOException::class)
constructor(sin: StreamInput) : this(
policyID = sin.readString(),
state = sin.readString(),
actionType = sin.readString(),
failed = sin.readBoolean()
policyID = sin.readOptionalString(),
state = sin.readOptionalString(),
actionType = sin.readOptionalString(),
failed = sin.readOptionalBoolean()
)

@Throws(IOException::class)
Expand All @@ -64,21 +64,23 @@ data class ExplainFilter(
}

fun validMetaData(metaData: ManagedIndexMetaData): Boolean {
var ok = true

val stateMetaData = metaData.stateMetaData
if (state != null && (stateMetaData == null || stateMetaData.name != state)) {
return false
ok = false
}

val actionMetaData = metaData.actionMetaData
if (actionType != null && (actionMetaData == null || actionMetaData.name != actionType)) {
return false
ok = false
}

if (failed != null && (actionMetaData == null || actionMetaData.failed != failed)) {
return false
ok = false
}

return true
return ok
}

companion object {
Expand Down

0 comments on commit 871952c

Please sign in to comment.