style: remove unneeded null check
This commit is contained in:
parent
eed25918d9
commit
efd569b5b0
|
@ -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")
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue