diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index ab14fd4058..4f1417300e 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -233,9 +233,13 @@ short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply) for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr( + err = AEGetNthPtr( &docList, i, typeFSRef, &keywd, &returnedType, (Ptr)&theRef, sizeof(theRef), &actualSize); + + if ( err != noErr) + return err; + fName = wxMacFSRefToPath( &theRef ) ; MacPrintFile(fName);