-
Notifications
You must be signed in to change notification settings - Fork 18
Translator crashes silently on nil path on iOS/iPad #11
Copy link
Copy link
Open
Description
Deleting the ~/Library/Application\ Support/Greenwich\ Translator folder fixes the problem until the next time its recreated. Attached is a simple fix that tests for nil on the "path" variable.
-
SK
-
(void)processUpdates:(NSMetadataQuery *)query {
[query disableUpdates];FRLocalizationWindowController *windowController = [[self class] sharedLocalizationWindowController];
for (NSUInteger i = 0; i < [query resultCount]; i++) {
NSMetadataItem *theResult = [query resultAtIndex:i];
NSString *path = [theResult valueForAttribute:(NSString *)kMDItemPath];
pragma mark - SK -
if ((path != nil) && (![knownContainers containsObject:path]))
pragma mark - /SK -
{
NSURL *appInfoURL = [NSURL fileURLWithPath:path];
NSURL *appURL = [appInfoURL URLByDeletingLastPathComponent];
NSDictionary *appInfo = [NSDictionary dictionaryWithContentsOfURL:appInfoURL];
if (appInfo) {
FRTranslationContainer *container =
[FRTranslationContainer containerForSyncedApplicationResources:appURL];
container.name = [appInfo objectForKey:kApplicationNameKey];
[windowController addContainer:container];
}
[knownContainers addObject:path];
}
}
[query enableUpdates];
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels