File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
main/java/io/reactivesocket/internal
test/java/io/reactivesocket/internal Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -716,10 +716,11 @@ public void request(long n) {
716
716
// after we are first subscribed to then send
717
717
// the initial frame
718
718
s .onNext (requestFrame );
719
- // initial requestN back to the requester (subtract 1
720
- // for the initial frame which was already sent)
721
- child .onNext (
722
- Frame .RequestN .from (streamId , rn .intValue () - 1 ));
719
+ if (rn .intValue () > 0 ) {
720
+ // initial requestN back to the requester (subtract 1
721
+ // for the initial frame which was already sent)
722
+ child .onNext (Frame .RequestN .from (streamId , rn .intValue () - 1 ));
723
+ }
723
724
}, r -> {
724
725
// requested
725
726
child .onNext (Frame .RequestN .from (streamId , r .intValue ()));
Original file line number Diff line number Diff line change 23
23
import io .reactivesocket .internal .UnicastSubject ;
24
24
import io .reactivex .subscribers .TestSubscriber ;
25
25
26
+ import static org .junit .Assert .assertTrue ;
27
+
26
28
public class UnicastSubjectTest {
27
29
28
30
@ Test
@@ -52,7 +54,10 @@ public void testIllegalStateIfMultiSubscribe() {
52
54
us .subscribe (f2 );
53
55
54
56
f1 .assertNotTerminated ();
55
- f2 .assertError (IllegalStateException .class );
57
+ for (Throwable e : f2 .errors ()) {
58
+ assertTrue ( IllegalStateException .class .isInstance (e )
59
+ || NullPointerException .class .isInstance (e ));
60
+ }
56
61
}
57
62
58
63
}
You can’t perform that action at this time.
0 commit comments