1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 03:45:35 +02:00

[188425] check for null selection before attempting to open dialog

This commit is contained in:
David McKnight 2007-05-23 13:25:49 +00:00
parent 572a213485
commit 7edc93c3d8

View file

@ -164,8 +164,9 @@ public class SystemCommonRenameAction extends SystemBaseDialogAction
*/ */
protected Dialog createDialog(Shell parent) protected Dialog createDialog(Shell parent)
{ {
IStructuredSelection sel = getSelection();
// multi-select // multi-select
if (getSelection().size() > 1) if (sel != null && sel.size() > 1)
{ {
SystemRenameDialog dlg = new SystemRenameDialog(parent); SystemRenameDialog dlg = new SystemRenameDialog(parent);
if (nameValidator != null) if (nameValidator != null)
@ -177,7 +178,7 @@ public class SystemCommonRenameAction extends SystemBaseDialogAction
return dlg; return dlg;
} }
// single-select // single-select
else if (getSelection().size() == 1) else if (sel != null && sel.size() == 1)
{ {
SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(parent); SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(parent);
if (copyCollisionMode) if (copyCollisionMode)