style: remove unneeded null check

This commit is contained in:
Alexander Klee 2024-05-17 10:10:06 +02:00
parent eed25918d9
commit efd569b5b0
2 changed files with 1 additions and 10 deletions

View File

@ -212,7 +212,7 @@ object SDom {
}
}
suspend fun downloadProblemStatement(contest: Contest, problem: Problem): ByteArray? {
suspend fun downloadProblemStatement(contest: Contest, problem: Problem): ByteArray {
val response: ByteArray = authenticatedClient.get(SDCredentials.url) {
url {
appendPathSegments("contests", contest.id, "problems", problem.id, "statement")

View File

@ -52,15 +52,6 @@ class SDStatementAction(name: String) : DumbAwareAction(name) {
}
CoroutineScope(Job() + Dispatchers.IO).launch {
val data = SDom.downloadProblemStatement(contest, problem)
if (data == null) {
NotificationGroupManager.getInstance()
.getNotificationGroup("sdom.notifications")
.createNotification("This problem lacks a problem statement", NotificationType.ERROR)
.setTitle("No problem statement")
.addAction(SDStatementAction("Retry"))
.notify(e.project)
return@launch
}
if (JBCefApp.isSupported()) {
val virtualFile = ByteVirtualFile("${problem.name}_${contest.name}.pdf", data)
ApplicationManager.getApplication().invokeLater {