Skip to content

Commit

Permalink
fix: don't crash profiler if we can not parse FrameTime
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Jun 28, 2024
1 parent 85656a7 commit 7d4e6e8
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,19 @@ export abstract class UnixProfiler implements Profiler {
const subProcessesStats = processOutput(cpu, pid);

const ram = processRamOutput(ramStr, this.getRAMPageSize());
const { frameTimes, interval: atraceInterval } = frameTimeParser.getFrameTimes(atrace, pid);

let output;
try {
output = frameTimeParser.getFrameTimes(atrace, pid);
} catch (e) {
console.error(e);
}

if (!output) {
return;
}

const { frameTimes, interval: atraceInterval } = output;

if (!initialTime) {
initialTime = timestamp;
Expand Down

0 comments on commit 7d4e6e8

Please sign in to comment.