mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Handle nil objects in property list ... treat as strings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20896 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fb8158c3c5
commit
15a0ad2875
2 changed files with 21 additions and 6 deletions
|
@ -1992,10 +1992,21 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
}
|
||||
else
|
||||
{
|
||||
NSString *cls;
|
||||
|
||||
if (obj == nil)
|
||||
{
|
||||
obj = @"(nil)";
|
||||
cls = @"(nil)";
|
||||
}
|
||||
else
|
||||
{
|
||||
cls = NSStringFromClass([obj class]);
|
||||
}
|
||||
|
||||
if (x == NSPropertyListXMLFormat_v1_0)
|
||||
{
|
||||
NSDebugLog(@"Non-property-list class (%@) encoded as string",
|
||||
NSStringFromClass([obj class]));
|
||||
NSDebugLog(@"Non-property-list class (%@) encoded as string", cls);
|
||||
[dest appendBytes: "<string>" length: 8];
|
||||
XString([obj description], dest);
|
||||
[dest appendBytes: "</string>" length: 9];
|
||||
|
@ -2010,14 +2021,13 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
{
|
||||
plobj = [desc propertyList];
|
||||
NSDebugLog(@"Non-property-list class (%@) "
|
||||
@"encoded as description's property-list",
|
||||
NSStringFromClass([obj class]));
|
||||
@"encoded as description's property-list", cls);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
plobj = desc;
|
||||
NSDebugLog(@"Non-property-list class (%@) encoded as string",
|
||||
NSStringFromClass([obj class]));
|
||||
NSDebugLog(@"Non-property-list class (%@) "
|
||||
@"encoded as string", cls);
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
OAppend(plobj, loc, lev, step, x, dest);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue