Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Preview crashing on several files under Lion "object cannot be nil"

Hi,


with several different files - old and new ones -, Preview simply crashes with the following error message after installing Lion on my MacBook Pro:


2011-08-15 09:16:06.255 Preview[435:60b] An uncaught exception was raised

2011-08-15 09:16:06.256 Preview[435:60b] *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil

2011-08-15 09:16:06.262 Preview[435:60b] (

0 CoreFoundation 0x00007fff8fe25986 __exceptionPreprocess + 198

1 libobjc.A.dylib 0x00007fff95bbed5e objc_exception_throw + 43

2 CoreFoundation 0x00007fff8fdcc818 -[__NSArrayM insertObject:atIndex:] + 296

3 Preview 0x0000000104f46cf9 Preview + 23801

4 Preview 0x0000000104f46a17 Preview + 23063

5 Preview 0x0000000104f465d1 Preview + 21969

6 Preview 0x0000000104f46175 Preview + 20853

7 libdispatch.dylib 0x00007fff9144990a _dispatch_call_block_and_release + 18

8 libdispatch.dylib 0x00007fff9144b77a _dispatch_main_queue_callback_4CF + 308

9 CoreFoundation 0x00007fff8fdbac0c __CFRunLoopRun + 1724

10 CoreFoundation 0x00007fff8fdba216 CFRunLoopRunSpecific + 230

11 HIToolbox 0x00007fff91dfb4ff RunCurrentEventLoopInMode + 277

12 HIToolbox 0x00007fff91e02c21 ReceiveNextEventCommon + 355

13 HIToolbox 0x00007fff91e02aae BlockUntilNextEventMatchingListInMode + 62

14 AppKit 0x00007fff92205191 _DPSNextEvent + 659

15 AppKit 0x00007fff92204a95 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135

16 AppKit 0x00007fff924baa4d -[NSApplication _realDoModalLoop:peek:] + 610

17 AppKit 0x00007fff924ba681 -[NSApplication runModalForWindow:] + 120

18 AppKit 0x00007fff924adf06 -[NSAlert runModal] + 159

19 AppKit 0x00007fff92233d66 -[NSPersistentUIManager promptToIgnorePersistentState] + 818

20 AppKit 0x00007fff922083dd -[NSApplication _reopenWindowsAsNecessaryIncludingRestorableState:registeringAsReady:completion Handler:] + 173

21 AppKit 0x00007fff92208241 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 227

22 AppKit 0x00007fff92207fb1 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 330

23 CoreFoundation 0x00007fff8fe17f51 -[NSObject performSelector:withObject:withObject:] + 65

24 Foundation 0x00007fff8c3791c7 __-[NSAppleEventManager setEventHandler:andSelector:forEventClass:andEventID:]_block_invoke_1 + 101

25 Foundation 0x00007fff8c37814e -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 283

26 Foundation 0x00007fff8c377fdc _NSAppleEventManagerGenericHandler + 105

27 AE 0x00007fff8cad9a85 _Z20aeDispatchAppleEventPK6AEDescPS_jPh + 200

28 AE 0x00007fff8cad9963 _ZL25dispatchEventAndSendReplyPK6AEDescPS_ + 38

29 AE 0x00007fff8cad9857 aeProcessAppleEvent + 250

30 HIToolbox 0x00007fff91e0a12d AEProcessAppleEvent + 102

31 AppKit 0x00007fff922053dd _DPSNextEvent + 1247

32 AppKit 0x00007fff92204a95 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135

33 AppKit 0x00007fff922013d6 -[NSApplication run] + 463

34 AppKit 0x00007fff9247f52a NSApplicationMain + 867

35 Preview 0x0000000104f42c64 Preview + 7268

36 ??? 0x0000000000000002 0x0 + 2

)

2011-08-15 09:16:06.263 Preview[435:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'

*** First throw call stack:

(

0 CoreFoundation 0x00007fff8fe25986 __exceptionPreprocess + 198

1 libobjc.A.dylib 0x00007fff95bbed5e objc_exception_throw + 43

2 CoreFoundation 0x00007fff8fdcc818 -[__NSArrayM insertObject:atIndex:] + 296

3 Preview 0x0000000104f46cf9 Preview + 23801

4 Preview 0x0000000104f46a17 Preview + 23063

5 Preview 0x0000000104f465d1 Preview + 21969

6 Preview 0x0000000104f46175 Preview + 20853

7 libdispatch.dylib 0x00007fff9144990a _dispatch_call_block_and_release + 18

8 libdispatch.dylib 0x00007fff9144b77a _dispatch_main_queue_callback_4CF + 308

9 CoreFoundation 0x00007fff8fdbac0c __CFRunLoopRun + 1724

10 CoreFoundation 0x00007fff8fdba216 CFRunLoopRunSpecific + 230

11 HIToolbox 0x00007fff91dfb4ff RunCurrentEventLoopInMode + 277

12 HIToolbox 0x00007fff91e02c21 ReceiveNextEventCommon + 355

13 HIToolbox 0x00007fff91e02aae BlockUntilNextEventMatchingListInMode + 62

14 AppKit 0x00007fff92205191 _DPSNextEvent + 659

15 AppKit 0x00007fff92204a95 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135

16 AppKit 0x00007fff924baa4d -[NSApplication _realDoModalLoop:peek:] + 610

17 AppKit 0x00007fff924ba681 -[NSApplication runModalForWindow:] + 120

18 AppKit 0x00007fff924adf06 -[NSAlert runModal] + 159

19 AppKit 0x00007fff92233d66 -[NSPersistentUIManager promptToIgnorePersistentState] + 818

20 AppKit 0x00007fff922083dd -[NSApplication _reopenWindowsAsNecessaryIncludingRestorableState:registeringAsReady:completion Handler:] + 173

21 AppKit 0x00007fff92208241 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 227

22 AppKit 0x00007fff92207fb1 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 330

23 CoreFoundation 0x00007fff8fe17f51 -[NSObject performSelector:withObject:withObject:] + 65

24 Foundation 0x00007fff8c3791c7 __-[NSAppleEventManager setEventHandler:andSelector:forEventClass:andEventID:]_block_invoke_1 + 101

25 Foundation 0x00007fff8c37814e -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 283

26 Foundation 0x00007fff8c377fdc _NSAppleEventManagerGenericHandler + 105

27 AE 0x00007fff8cad9a85 _Z20aeDispatchAppleEventPK6AEDescPS_jPh + 200

28 AE 0x00007fff8cad9963 _ZL25dispatchEventAndSendReplyPK6AEDescPS_ + 38

29 AE 0x00007fff8cad9857 aeProcessAppleEvent + 250

30 HIToolbox 0x00007fff91e0a12d AEProcessAppleEvent + 102

31 AppKit 0x00007fff922053dd _DPSNextEvent + 1247

32 AppKit 0x00007fff92204a95 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135

33 AppKit 0x00007fff922013d6 -[NSApplication run] + 463

34 AppKit 0x00007fff9247f52a NSApplicationMain + 867

35 Preview 0x0000000104f42c64 Preview + 7268

36 ??? 0x0000000000000002 0x0 + 2

)

terminate called throwing an exception


I have looked around for tips, but none of them seem to resolve the problem. Any help would be appreciated!

Mac OS X (10.7)

Posted on Aug 15, 2011 12:25 AM

Reply
5 replies

Aug 21, 2011 12:21 PM in response to GuidoR

I have run some further tests. While I am still not sure what the underlying problem is, here's what happens in an example.

  1. I create a new PDF from LaTeX using MacTeX 2011's pdflatex.
  2. I run "Preview xxx.pdf" from the shell; Preview crashes as stated above.
  3. I run "Preview" from the shell (note: no parameter), click "Don't restore Windows", and then manually open the pdf file inside Preview. The PDF is now shown without problems.

The same happens in many cases if I replace running "Preview xxx.pdf" in the shell by opening the PDF file by double clicking it in Finder.


Strange...

Preview crashing on several files under Lion "object cannot be nil"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.