How to check whether a resource is available yet in online experiment?

URL of experiment:
https://run.pavlovia.org/qyk/dcm_day1/?__pilotToken=9bf31c7ff062936a96d3c8bd1f8f2ff3&__oauthToken=ddc5a674687d0a6302e8da43befde5b8cc66ab2db44fde350c32542f9ebb0645
Description of the problem:
I make the block condition file as a variable and it will be preload in the first routine online.
But sometimes, procedures occur error when the next routine was executed but the condition file has not fully loaded. I want to know How to check whether a resource is available in the builder mode?

Have a look at the download resources section of my code snippets page

However, don’t use Download Resources in combination with the latest version of PsychoPy – though the test should still work

Each Frame
try {
psychoJS.serverManager.getResource(expInfo["participant"] + ".jpg");
    continueRoutine = false;
} catch (e) {}

Thanks!!!