From dee23e76e82e5495152c874bfe07f75af6710518 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Mon, 6 Jul 2009 18:45:41 +0200 Subject: [PATCH] Fixed searching of the database file --- ThingsPlugin.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ThingsPlugin.m b/ThingsPlugin.m index 3e27d4f..3357197 100644 --- a/ThingsPlugin.m +++ b/ThingsPlugin.m @@ -60,11 +60,12 @@ - (id)init { preferences = [[NSMutableDictionary alloc] initWithContentsOfFile:preferencesPath]; queryLimit = [[preferences valueForKey:@"Limit"] intValue]; + + NSFileManager* fm = [NSFileManager defaultManager]; NSString* databasePath = [preferences objectForKey:@"databasePath"]; - if(databasePath == nil || [databasePath length] == 0) { + if(databasePath == nil || [fm fileExistsAtPath:[preferences objectForKey:@"databasePath"]]) { NSLog(@"We do not have the database path, going to search for it."); - NSFileManager* fm = [NSFileManager defaultManager]; NSString* appPath = @"/User/Applications/"; NSArray* uuidDirs = [fm directoryContentsAtPath:appPath];