File tree 2 files changed +14
-2
lines changed
test/screens/cpu_profiler
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1223,7 +1223,7 @@ class _CpuProfileTimelineTree {
1223
1223
if (isCodeTree) {
1224
1224
return _code.function! ;
1225
1225
}
1226
- final function = samples.functions! [index].function;
1226
+ final function = samples.functions? [index].function;
1227
1227
if (function is vm_service.FuncRef ||
1228
1228
function is vm_service.NativeFunction ) {
1229
1229
return function;
@@ -1263,7 +1263,7 @@ class _CpuProfileTimelineTree {
1263
1263
// critical since this is only displayed when VM developer mode is
1264
1264
// enabled.
1265
1265
(_function as vm_service.FuncRef ? )? .location? .script? .uri
1266
- : samples.functions! [index].resolvedUrl;
1266
+ : samples.functions? [index].resolvedUrl;
1267
1267
1268
1268
int ? get sourceLine {
1269
1269
final function = _function;
Original file line number Diff line number Diff line change @@ -122,6 +122,18 @@ void main() {
122
122
);
123
123
});
124
124
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
+
125
137
test ('to json defaults packageUri to resolvedUrl' , () {
126
138
const id = '140357727781376-12' ;
127
139
You can’t perform that action at this time.
0 commit comments