Fix ForwardingWriter init preconditions

pull/2861/head
Jorge Canizales 9 years ago
parent 95a98ca768
commit c678c30cf1
  1. 5
      src/objective-c/RxLibrary/GRXForwardingWriter.m

@ -48,7 +48,10 @@
// Designated initializer
- (instancetype)initWithWriter:(GRXWriter *)writer {
if (!writer) {
[NSException raise:NSInvalidArgumentException format:@"writer can't be nil."];
return nil;
}
if (writer.state != GRXWriterStateNotStarted) {
[NSException raise:NSInvalidArgumentException format:@"writer can't be started."];
}
if ((self = [super init])) {
_writer = writer;

Loading…
Cancel
Save