diff -r b1cc3c1b5028 -r 06e2064de820 libraries/iosrv/server/readwrite.cpp --- a/libraries/iosrv/server/readwrite.cpp Wed Jul 28 18:30:18 2010 +0100 +++ b/libraries/iosrv/server/readwrite.cpp Sat Jul 31 18:44:26 2010 +0100 @@ -362,8 +362,13 @@ ReadEndPoint()->IorepDetach(*this); } - aEndPoint.IorepAttachL(*this, aMode); iEndPoint = &aEndPoint; + TRAPD(err, aEndPoint.IorepAttachL(*this, aMode)); + if (err) + { + iEndPoint = NULL; + User::Leave(err); + } } void CIoReadObject::SetReadMode(RIoReadHandle::TReadMode aMode) @@ -954,8 +959,13 @@ WriteEndPoint()->IowepDetach(*this); } - aEndPoint.IowepAttachL(*this); iEndPoint = &aEndPoint; + TRAPD(err, aEndPoint.IowepAttachL(*this)); + if (err) + { + iEndPoint = NULL; + User::Leave(err); + } } void CIoWriteObject::WriteL(const RMsg& aMessage)