Chart Js pie Chart/ donut "null' error

when previewing, if your data is null then an error appears that leaves the page useless unless you refresh. See the video below

Here is the error: “The plugin Chart JS - Charts and Graphs / element Chart - Pie/Donut threw the following error: TypeError: Cannot read properties of null (reading ‘includes’)”