Create from usage: Changed checking list.getSelectedIndex() for < 0 to checking list.getSelectedValue() for null.
This commit is contained in:
@@ -632,9 +632,8 @@ public class CreateFunctionFromUsageFix extends CreateFromUsageFixBase {
|
|||||||
Runnable runnable = new Runnable() {
|
Runnable runnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
int index = list.getSelectedIndex();
|
|
||||||
if (index < 0) return;
|
|
||||||
ClassCandidate selectedCandidate = (ClassCandidate) list.getSelectedValue();
|
ClassCandidate selectedCandidate = (ClassCandidate) list.getSelectedValue();
|
||||||
|
if (selectedCandidate == null) return;
|
||||||
selectedReceiverType = selectedCandidate.getTypeCandidate();
|
selectedReceiverType = selectedCandidate.getTypeCandidate();
|
||||||
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
|
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user