This crashes my program: ``` val job = Supervi...
# coroutines
u
This crashes my program:
Copy code
val job = SupervisorJob()
    val deferred = CompletableDeferred<Unit>()
    GlobalScope.launch(job, start = UNDISPATCHED) {
        try {
            deferred.await()
            println("after await!")
        } catch (e: CancellationException) {
            throw e
        } catch (e: Exception) {
            println("exception during await(): ${e.message}")
        }
    }

    job.cancelChildren()
    runBlocking { job.children.forEach { it.join() } }

    deferred.cancel(IllegalArgumentException())
Given that
deferred.cancel()
is done in a library that I can't change, what do I have to change in order for this code to not crash my program?