Merge pull request #1802 from benphelps/fix/issue-1747

Fix jobStats potentially accessed before instantiated
This commit is contained in:
shamoon
2023-08-11 08:00:22 -07:00
committed by GitHub

View File

@@ -31,7 +31,7 @@ export default function Component({ service }) {
const printingStateFalgs = ["Printing", "Paused", "Pausing", "Resuming"];
if (printingStateFalgs.includes(state)) {
const { completion } = jobStats.progress;
const { completion } = jobStats?.progress ?? undefined;
if (!jobStats || !completion) {
return (