* Source/NSUnarchiver.m: Issue a warning when the class can't be

resolved by the runtime in decodeValueOfObjCType:at:.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26722 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2008-06-27 21:49:27 +00:00
parent 36a2205b4f
commit f39466eb13
2 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-06-27 17:22-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSUnarchiver.m: Issue a warning when the class can't be
resolved by the runtime in decodeValueOfObjCType:at:.
2008-06-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPropertyList.m: sort dictionary keys only if they are

View file

@ -740,7 +740,7 @@ static Class NSDataMallocClass;
(*desImp)(src, desSel, &cver, @encode(unsigned), &cursor, nil);
if (className == 0)
{
NSLog(@"[%s %s] decoded nil class",
NSLog(@"[%s %s] decoded nil class name",
GSNameFromClass([self class]), GSNameFromSelector(_cmd));
className = @"_NSUnarchiverUnknownClass";
}
@ -750,6 +750,15 @@ static Class NSDataMallocClass;
classInfo = [NSUnarchiverObjectInfo
newWithName: className];
c = NSClassFromString(className);
/*
* Show a warning, if the class name that's being used to build the
* class causes NSClassFromString to return nil. This means that the
* class is unknown to the runtime.
*/
if(c == nil)
{
NSLog(@"Got nil when trying to unarchive class %s",className);
}
[classInfo mapToClass: c withName: className];
[objDict setObject: classInfo forKey: className];
RELEASE(classInfo);