mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 22:35:43 +02:00
Fix potential NPEs
Change-Id: I1648e8bda4de9129ae15432e73b070d64b8c3e17 Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
parent
45072181ad
commit
da73772cb7
2 changed files with 3 additions and 2 deletions
|
@ -264,7 +264,7 @@ public class RemoteResourceBrowser extends Dialog implements IRunnableContext {
|
|||
* connection that supports the IRemoteFileService service
|
||||
*/
|
||||
public void setConnection(IRemoteConnection connection) {
|
||||
if (connection.hasService(IRemoteFileService.class)) {
|
||||
if (connection != null && connection.hasService(IRemoteFileService.class)) {
|
||||
fConnection = connection;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -220,6 +220,8 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
fRemoteConnectionWidget = new RemoteConnectionWidget(mainComp, SWT.NONE, "", //$NON-NLS-1$
|
||||
(fOptionFlags & SHOW_LOCAL_SELECTION) == 0 ? RemoteConnectionWidget.FLAG_NO_LOCAL_SELECTION : 0);
|
||||
fRemoteConnectionWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
|
||||
// Must happen before adding selection listener as this will trigger selection event
|
||||
fRemoteConnectionWidget.filterConnections(IRemoteFileService.class);
|
||||
fRemoteConnectionWidget.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
|
@ -237,7 +239,6 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
}));
|
||||
}
|
||||
});
|
||||
fRemoteConnectionWidget.filterConnections(IRemoteFileService.class);
|
||||
}
|
||||
|
||||
Composite textComp = new Composite(mainComp, SWT.NONE);
|
||||
|
|
Loading…
Add table
Reference in a new issue