mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: CPBundle -bundleWithIdentifier did not create CPBundle when necessary.
Previously, if a CFBundle with the given identifier had been loaded, but no CPBundle had yet been created with the given identifier, -bundleWithIdentifier would return nil instead of a newly constructed CPBundle with the CFBundle's URL. This commit correctly returns a newly constructed CPBundle when a CFBundle is found.
This commit is contained in:
+10
-2
@@ -56,9 +56,17 @@ var CPBundlesForURLStrings = { };
|
||||
var bundle = CFBundle.bundleWithIdentifier(anIdentifier);
|
||||
|
||||
if (bundle)
|
||||
bundle = CPBundlesForURLStrings[bundle.bundleURL().absoluteString()] || nil;
|
||||
{
|
||||
var url = bundle.bundleURL(),
|
||||
cpBundle = CPBundlesForURLStrings[url.absoluteString()];
|
||||
|
||||
return bundle;
|
||||
if (!cpBundle)
|
||||
cpBundle = [self bundleWithURL:url];
|
||||
|
||||
return cpBundle;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (CPBundle)bundleForClass:(Class)aClass
|
||||
|
||||
Reference in New Issue
Block a user