File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -148,9 +148,10 @@ window.onunhandledrejection = async function onUnhandledRejection(event) {
148148} ;
149149
150150// Monkeypatch p5._friendlyError
151- const p5Call = window . p5 ;
152151
153- if ( p5Call ) {
152+ const _report = window . p5 ?. report ;
153+
154+ if ( _report ) {
154155 window . p5 . _report = function resolvedReport ( message , method , color ) {
155156 const urls = Object . keys ( window . objectUrls ) ;
156157 const paths = Object . keys ( window . objectPaths ) ;
@@ -176,6 +177,6 @@ if (p5Call) {
176177 paths . forEach ( ( path ) => {
177178 newMessage = newMessage . replaceAll ( path , window . objectPaths [ path ] ) ;
178179 } ) ;
179- p5Call . apply ( window . p5 , [ newMessage , method , color ] ) ;
180+ _report . apply ( window . p5 , [ newMessage , method , color ] ) ;
180181 } ;
181182}
You can’t perform that action at this time.
0 commit comments