From b442a9920d8e873c4df7b84799aa49e551922e2d Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 25 Jan 2013 20:14:11 +0000 Subject: Fix more warnings. --- Source/SPEditSheetTextView.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/SPEditSheetTextView.m') diff --git a/Source/SPEditSheetTextView.m b/Source/SPEditSheetTextView.m index 8ddbb665..8548271f 100644 --- a/Source/SPEditSheetTextView.m +++ b/Source/SPEditSheetTextView.m @@ -197,12 +197,14 @@ } // Check size and NSFileType - NSDictionary *attr = [[NSFileManager defaultManager] fileAttributesAtPath:filepath traverseLink:YES]; - if(attr) + NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:filepath error:nil]; + + if (attr) { NSNumber *filesize = [attr objectForKey:NSFileSize]; NSString *filetype = [attr objectForKey:NSFileType]; - if(filetype == NSFileTypeRegular && filesize) + + if (filetype == NSFileTypeRegular && filesize) { // Ask for confirmation if file content is larger than 1MB if([filesize unsignedLongValue] > 1000000) -- cgit v1.2.3