Fixed: framework image names without @framework would cause nib2cib to fail.

I wasn't properly handling the case where _resourcePathForName would be called with a nil framework.
This commit is contained in:
Aparajita Fishman committed 2013-05-14 07:54:08 -04:00
1 parent 9bde63923c
commit eb859d42a4
1 file changed
+6 -3
+6 -3
View File
@@ -52,7 +52,10 @@ var FILE = require("file");
else if (!info.resourceDirectory)
[CPException raise:Nib2CibException format:@"The framework “%@” specified by the image “%@@%@” has no Resources directory.", framework, aName, framework];
return { path:[self _resourcePathForName:aName inDirectory:info.resourceDirectory], framework:framework };
var path = [self _resourcePathForName:aName inDirectory:info.resourceDirectory];
if (path)
return { path:path, framework:framework };
}
else
{
@@ -79,7 +82,7 @@ var FILE = require("file");
}
}
return nil;
[CPException raise:Nib2CibException format:@"The image “%@” cannot be found.", aName];
}
- (CPString)_resourcePathForName:(CPString)aName inDirectory:(CPString)directory
@@ -107,7 +110,7 @@ var FILE = require("file");
}
}
[CPException raise:Nib2CibException format:@"The image “%@” cannot be found in %@.", aName, directory];
return nil;
}
@end