Fixed that at view initialization window is still null and therefore call to currentStage for dialogService.showErrorMessage() crashes

This commit is contained in:
dankito 2020-05-14 22:27:49 +02:00
parent 0e0d553c0b
commit ed5d4bb241
1 changed files with 8 additions and 2 deletions

View File

@ -97,7 +97,7 @@ open class EnterTanDialog(
}
}
else {
showDecodingTanChallengeFailedError(flickerCode.decodingError)
showDecodingTanChallengeFailedErrorOnViewInitialization(flickerCode.decodingError)
}
}
@ -113,7 +113,7 @@ open class EnterTanDialog(
})
}
else {
showDecodingTanChallengeFailedError(decodedImage.decodingError)
showDecodingTanChallengeFailedErrorOnViewInitialization(decodedImage.decodingError)
}
}
@ -184,6 +184,12 @@ open class EnterTanDialog(
}
protected open fun showDecodingTanChallengeFailedErrorOnViewInitialization(error: Exception?) {
runLater {
showDecodingTanChallengeFailedError(error)
}
}
protected open fun showDecodingTanChallengeFailedError(error: Exception?) {
dialogService.showErrorMessage(String.format(messages["enter.tan.dialog.error.could.not.decode.tan.image"], error?.localizedMessage),
null, error, currentStage)