File tree 1 file changed +5
-2
lines changed
flutter-idea/src/io/flutter/run/daemon
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,12 @@ DeviceSelection withDevices(@NotNull List<FlutterDevice> newDevices) {
46
46
final Optional <FlutterDevice > selectedDevice = findById (newDevices , selectedId );
47
47
48
48
// If there's no selected device, default the first ephemoral one in the list.
49
- final FlutterDevice firstEphemoral =
49
+ FlutterDevice firstEphemeral =
50
50
newDevices .stream ().filter (FlutterDevice ::ephemeral ).findFirst ().orElse (null );
51
- return new DeviceSelection (ImmutableList .copyOf (newDevices ), selectedDevice .orElse (firstEphemoral ));
51
+ if (firstEphemeral == null && !newDevices .isEmpty ()) {
52
+ firstEphemeral = newDevices .get (0 );
53
+ }
54
+ return new DeviceSelection (ImmutableList .copyOf (newDevices ), selectedDevice .orElse (firstEphemeral ));
52
55
}
53
56
54
57
/**
You can’t perform that action at this time.
0 commit comments