Create from usage: Changed checking list.getSelectedIndex() for < 0 to checking list.getSelectedValue() for null.

This commit is contained in:
Jack Zhou
2013-05-02 10:57:54 -04:00
parent f3e6c70e40
commit 7e5c04ad6d
@@ -632,9 +632,8 @@ public class CreateFunctionFromUsageFix extends CreateFromUsageFixBase {
Runnable runnable = new Runnable() {
@Override
public void run() {
int index = list.getSelectedIndex();
if (index < 0) return;
ClassCandidate selectedCandidate = (ClassCandidate) list.getSelectedValue();
if (selectedCandidate == null) return;
selectedReceiverType = selectedCandidate.getTypeCandidate();
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
@Override