File tree Expand file tree Collapse file tree
test/screens/cpu_profiler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1223,7 +1223,7 @@ class _CpuProfileTimelineTree {
12231223 if (isCodeTree) {
12241224 return _code.function! ;
12251225 }
1226- final function = samples.functions! [index].function;
1226+ final function = samples.functions? [index].function;
12271227 if (function is vm_service.FuncRef ||
12281228 function is vm_service.NativeFunction ) {
12291229 return function;
@@ -1263,7 +1263,7 @@ class _CpuProfileTimelineTree {
12631263 // critical since this is only displayed when VM developer mode is
12641264 // enabled.
12651265 (_function as vm_service.FuncRef ? )? .location? .script? .uri
1266- : samples.functions! [index].resolvedUrl;
1266+ : samples.functions? [index].resolvedUrl;
12671267
12681268 int ? get sourceLine {
12691269 final function = _function;
Original file line number Diff line number Diff line change @@ -122,6 +122,18 @@ void main() {
122122 );
123123 });
124124
125+ test ('converts samples with no functions regression test' , () {
126+ expect (
127+ // False positive for this lint, it is used by the matcher.
128+ // ignore: discarded_futures
129+ CpuProfileData .generateFromCpuSamples (
130+ isolateId: goldenSamplesIsolate,
131+ cpuSamples: CpuSamples .parse (goldenCpuSamplesJson)! ..functions = null ,
132+ ),
133+ completes,
134+ );
135+ });
136+
125137 test ('to json defaults packageUri to resolvedUrl' , () {
126138 const id = '140357727781376-12' ;
127139
You can’t perform that action at this time.
0 commit comments