mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
bug 428424: fix NPE while playing with
org.eclipse.cdt.visualizer.examples Change-Id: I239c7c6594dd5864459ed47c47a1888607ecdaa2 Signed-off-by: Xavier Raynaud <xavier.raynaud@kalray.eu> Reviewed-on: https://git.eclipse.org/r/22156 Reviewed-by: William Swanson <traveler@tilera.com> Reviewed-by: Marc Dumais <marc.dumais@ericsson.com> IP-Clean: Marc Dumais <marc.dumais@ericsson.com> Tested-by: Marc Dumais <marc.dumais@ericsson.com>
This commit is contained in:
parent
f54cf7280e
commit
22c1ce3d27
1 changed files with 8 additions and 4 deletions
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* William R. Swanson (Tilera Corporation)
|
||||
* Xavier Raynaud <xavier.raynaud@kalray.eu> - fix #428424
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.visualizer.examples.sourcegraph;
|
||||
|
@ -137,10 +138,13 @@ public class SourceGraphVisualizer extends Visualizer
|
|||
*/
|
||||
@Override
|
||||
public void workbenchSelectionChanged(ISelection selection) {
|
||||
TextSelection s =
|
||||
(TextSelection) SelectionUtils.getSelectedObject(selection);
|
||||
String text = s.getText();
|
||||
m_sourceGraphControl.setSourceText(text);
|
||||
Object o = SelectionUtils.getSelectedObject(selection);
|
||||
if (o instanceof TextSelection) {
|
||||
String text = ((TextSelection) o).getText();
|
||||
m_sourceGraphControl.setSourceText(text);
|
||||
} else {
|
||||
m_sourceGraphControl.setSourceText(""); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
public SelectionManager getSelectionManager() {
|
||||
|
|
Loading…
Add table
Reference in a new issue