diff --git a/Source/NSKeyedArchiver.m b/Source/NSKeyedArchiver.m index 18e3d118f..efbb47d7f 100644 --- a/Source/NSKeyedArchiver.m +++ b/Source/NSKeyedArchiver.m @@ -556,6 +556,17 @@ static NSDictionary *makeReference(unsigned ref) return _delegate; } +- (NSString*) description +{ + if (_data == nil) + { + // For consistency with OSX + [NSException raise: NSInvalidArgumentException + format: @"method sent to uninitialised archiver"]; + } + return [super description]; +} + - (void) encodeArrayOfObjCType: (const char*)aType count: (NSUInteger)aCount at: (const void*)address diff --git a/Source/NSKeyedUnarchiver.m b/Source/NSKeyedUnarchiver.m index f73db8a30..c12eeab59 100644 --- a/Source/NSKeyedUnarchiver.m +++ b/Source/NSKeyedUnarchiver.m @@ -749,6 +749,17 @@ static NSMapTable *globalClassMap = 0; return _delegate; } +- (NSString*) description +{ + if (_archive == nil) + { + // For consistency with OSX + [NSException raise: NSInvalidArgumentException + format: @"method sent to uninitialised unarchiver"]; + } + return [super description]; +} + - (void) finishDecoding { [_delegate unarchiverWillFinish: self];