diff -r 465613364af0 -r 8c545fea2798 contentmgmt/contentaccessfwfordrm/source/reccaf/CafApaRecognizer.cpp --- a/contentmgmt/contentaccessfwfordrm/source/reccaf/CafApaRecognizer.cpp Thu Jul 22 20:18:20 2010 +0530 +++ b/contentmgmt/contentaccessfwfordrm/source/reccaf/CafApaRecognizer.cpp Thu Aug 12 21:07:10 2010 +0530 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -227,36 +227,45 @@ else { RFile* fileHandle = CApaCafRecognizer::FilePassedByHandleL(); + + if( fileHandle == NULL ) + { + return; + } + TBuf fileName; User::LeaveIfError(fileHandle->Name(fileName)); isRecognized = iResolver->DoRecognizeL(fileName, aBuffer, FileMimeType, ContentMimeType); } - if (isRecognized) - { - // If there is no content type but the file is recognized it is assumed - // to be a file that can be processed through the supplier interface - - // dummy object for comparison in match function - CMimeTypeMapping* mimeTypeMapping = (ContentMimeType.Length() == 0) ? - CMimeTypeMapping::NewL(FileMimeType) : - CMimeTypeMapping::NewL(ContentMimeType); + if (isRecognized == EFalse) + { + return; + } - // check that the content mime type is one of the ones we - // told Apparc we can recognize in the beginning - // The mime type should always be found as the file has been recognised. - // If not it is because an agent, when recognising the file, has set a mime type not in its supplier list. - // Mime types are always forced to lower case therefore this match can be case sensitive. - TInt index = iContentTypes.Find(mimeTypeMapping, CMimeTypeMapping::ContentMimeTypeMatch); - if (index != KErrNotFound) - { - iDataType = TDataType(iContentTypes[index]->CafMimeType()); - iConfidence=ECertain; - } + // If there is no content type but the file is recognized it is assumed + // to be a file that can be processed through the supplier interface + + // dummy object for comparison in match function + CMimeTypeMapping* mimeTypeMapping = (ContentMimeType.Length() == 0) ? + CMimeTypeMapping::NewL(FileMimeType) : + CMimeTypeMapping::NewL(ContentMimeType); + - delete mimeTypeMapping; - } + // check that the content mime type is one of the ones we + // told Apparc we can recognize in the beginning + // The mime type should always be found as the file has been recognised. + // If not it is because an agent, when recognising the file, has set a mime type not in its supplier list. + // Mime types are always forced to lower case therefore this match can be case sensitive. + TInt index = iContentTypes.Find(mimeTypeMapping, CMimeTypeMapping::ContentMimeTypeMatch); + if (index != KErrNotFound) + { + iDataType = TDataType(iContentTypes[index]->CafMimeType()); + iConfidence=ECertain; + } + + delete mimeTypeMapping; } const TImplementationProxy ImplementationTable[] =