Skip to content

[flutter_tools] RangeError in TargetDeviceSelection.userSelectDevice #129191

@christopherfujino

Description

@christopherfujino

On beta/3.12.0

RangeError: RangeError (index): Invalid value: Not in inclusive range 0..1: -1
at List.[](growable_array.dart:264)
at TargetDeviceSelection.userSelectDevice(target_devices.dart:778)
at <asynchronous gap>(async)
at TargetDevicesWithExtendedWirelessDeviceDiscovery._selectFromDevicesAndCheckForWireless(target_devices.dart:707)
at <asynchronous gap>(async)
at RunCommand.validateCommand(run.dart:535)
at <asynchronous gap>(async)
at FlutterCommand.verifyThenRunCommand(flutter_command.dart:1481)
at <asynchronous gap>(async)
at FlutterCommand.run.<anonymous closure>(flutter_command.dart:1297)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at CommandRunner.runCommand(command_runner.dart:212)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand.<anonymous closure>(flutter_command_runner.dart:336)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand(flutter_command_runner.dart:284)
at <asynchronous gap>(async)
at run.<anonymous closure>.<anonymous closure>(runner.dart:115)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at main(executable.dart:91)
at <asynchronous gap>(async)

I think the answer is to have an explicit check that this user input is a valid list index.

Metadata

Metadata

Assignees

Labels

c: crashStack traces logged to the consoletoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions