Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317135

Summary: Null pointer exception in Tree.collapseItem_collapseChildren
Product: [Eclipse Project] Platform Reporter: Chris Allen <kosmos2121>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: lshanmug, skovatch
Version: 3.6   
Target Milestone: 3.7.1   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Chris Allen CLA 2010-06-16 21:19:01 EDT
Build Identifier: M20100211-1343

I am having an issue where when I collapse a Tree branch, I get a null pointer exception in Tree.collapseItem_collapseChildren.  In reviewing the swt code, it looks like (TreeItem)display.getWidget(itemID) can potentially return null and there is no checking to catch this case.  Why it's returning null, I do not know yet, but it seems like you'd want to catch it just in case.  I have tried using SWT versions swt-3.5.2-cocoa-macosx-x86_64 and swt-3.6RC4-cocoa-macosx-x86_64.  I am running the latest version of Java 6 (1.6.0_20-b02-279-9M3165) on OSX 10.5.8 (Mac OS X Server 10.5.8 (9L34)).  Any suggestions to help identify if there is a problem in my code would be appreciated.

Reproducible: Sometimes

Steps to Reproduce:
1. click on tree branch that contains sub objects to collapse the tree
2.
3.
Comment 1 Scott Kovatch CLA 2010-07-06 17:35:03 EDT
This sounds like bug 309753, but you're reporting it against 3.6RC4 and we fixed that for 3.6RC1. Can you paste in a stack trace of the exception?
Comment 2 Lakshmi P Shanmugam CLA 2017-07-03 05:36:35 EDT
Null check has been added via Bug 326311. Marking as fixed.