Skip to content
Snippets Groups Projects
Commit c678c30c authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Fix ForwardingWriter init preconditions

parent 95a98ca7
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,10 @@ ...@@ -48,7 +48,10 @@
// Designated initializer // Designated initializer
- (instancetype)initWithWriter:(GRXWriter *)writer { - (instancetype)initWithWriter:(GRXWriter *)writer {
if (!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])) { if ((self = [super init])) {
_writer = writer; _writer = writer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment