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
commit 3b1c9a69a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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