Commit 6b4de25
committed
Use
`at` throws an exception when the value is missing. `at` is not
recommended. https://abseil.io/tips/224 has similar advice on
`std::vector::at`, go/totw/132#safe-lookup recommends a specific
alternative for maps.
This fixes the error
```
libc++abi: terminating due to uncaught exception of type std::out_of_range: absl::btree_map::at
```
Full invocation:
```
$ bazel run //cuttlefish/package:cvd -- fetch --default_build=git_main/aosp_cf_x86_64_only_phone-trunk_staging-userdebug --target_directory=$HOME/dl
$ bazel run //cuttlefish/package:cvd -- create --host_path=$HOME/dl --product_path=$HOME/dl --host_substitutions=bin/assemble_cvd,bin/run_cvd
...
SetFlagDefaultsFromConfig: No flag defaults to override.
libc++abi: terminating due to uncaught exception of type std::out_of_range: absl::btree_map::at
11-18 16:15:21.590 3669390 3669390 E cvd_internal_start: subprocess.cpp:207 Subprocess 3669416 was interrupted by a signal 'Aborted' (6)
11-18 16:15:21.591 3669390 3669390 E cvd_internal_start: main.cc:296 assemble_cvd returned -1
11-18 16:15:21.591 3667884 3667884 I cvd : start.cpp:547 Device launch failed, cleaning up
```
Bug: b/461899525find in Defaults::Value() to check for presence1 parent 513a4c4 commit 6b4de25
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
| |||
0 commit comments