Handle missing image better

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@38624 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2015-06-12 09:55:32 +00:00
parent 635a857419
commit fdae99568e
2 changed files with 12 additions and 3 deletions

View file

@ -6,6 +6,9 @@
* Framework/PCEditorManager.m
Use the internal editor if it is available, even if no parser is available.
* Modules/Editors/ProjectCenter/PCEditor.m
Handle missing image better.
2015-04-07 Riccardo Mottola <rm@gnu.org>
* Modules/Editors/ProjectCenter/PCEditorView.m

View file

@ -488,10 +488,16 @@
}
bundle = [NSBundle bundleForClass:NSClassFromString(@"PCEditor")];
imagePath = [bundle pathForResource:imageName ofType:@"tiff"];
image = [[NSImage alloc] initWithContentsOfFile:imagePath];
if (imagePath)
{
image = [[NSImage alloc] initWithContentsOfFile:imagePath];
}
else
{
NSLog(@"no image for %@", imageName);
}
return AUTORELEASE(image);
}