BLIP/BLIPRequest.m
changeset 20 02224e981209
parent 2 9fdd8dba529c
child 22 8b883753394a
     1.1 --- a/BLIP/BLIPRequest.m	Sat May 24 17:25:06 2008 -0700
     1.2 +++ b/BLIP/BLIPRequest.m	Sun Jul 13 10:52:48 2008 -0700
     1.3 @@ -199,6 +199,8 @@
     1.4          setObj(&_mutableBody,nil);
     1.5          
     1.6          BLIPMutableProperties *errorProps = [self.properties mutableCopy];
     1.7 +        if( ! errorProps )
     1.8 +            errorProps = [[BLIPMutableProperties alloc] init];
     1.9          NSDictionary *userInfo = error.userInfo;
    1.10          for( NSString *key in userInfo ) {
    1.11              id value = $castIf(NSString,[userInfo objectForKey: key]);
    1.12 @@ -227,8 +229,12 @@
    1.13  {
    1.14      Assert(_connection,@"%@ has no connection to send over",self);
    1.15      Assert(!_sent,@"%@ was already sent",self);
    1.16 +    BLIPWriter *writer = (BLIPWriter*)_connection.writer;
    1.17 +    Assert(writer,@"%@'s connection has no writer (already closed?)",self);
    1.18      [self _encode];
    1.19 -    return (self.sent = [(BLIPWriter*)_connection.writer sendMessage: self]);
    1.20 +    BOOL sent = self.sent = [writer sendMessage: self];
    1.21 +    Assert(sent);
    1.22 +    return sent;
    1.23  }
    1.24  
    1.25