Skip to content

Commit 669a84f

Browse files
elizarovqwwdfsad
authored andcommitted
Fixed diagnostic message on null subscriber
1 parent 8cced24 commit 669a84f

File tree

1 file changed

+1
-1
lines changed
  • reactive/kotlinx-coroutines-reactive/src

1 file changed

+1
-1
lines changed

reactive/kotlinx-coroutines-reactive/src/Publish.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public fun <T> CoroutineScope.publish(
4343
@BuilderInference block: suspend ProducerScope<T>.() -> Unit
4444
): Publisher<T> = Publisher { subscriber ->
4545
// specification requires NPE on null subscriber
46-
if (subscriber == null) throw NullPointerException("subscriber")
46+
if (subscriber == null) throw NullPointerException("Subscriber cannot be null")
4747
val newContext = newCoroutineContext(context)
4848
val coroutine = PublisherCoroutine(newContext, subscriber)
4949
subscriber.onSubscribe(coroutine) // do it first (before starting coroutine), to avoid unnecessary suspensions

0 commit comments

Comments
 (0)