Img.line() crash in Safari

Hello. I am working on a p5js piece and having good success. Everything works beautifully in Chrome on desktop and mobile. However, in Safari and on iPhone, the project crashes. I have narrowed it down to one line:
bg.line( this.x, this.y, this.px, this.py );

I am making sure my this.x, this.y, this.px and this.py values are good. I am making sure the distance between these two points is non-zero. I am not sure what else to try. I realize this might be a bit too vague, but maybe someone else has experienced this and remembers a solution?

It is proving to be challenging to debug because in the P5JS editor in safari, when I run the project, it goes for a few frames then either freezes the window, or triggers a rapid refresh of the browser a couple times before throwing a error.

Thanks,
Robert

I don’t think this has anything to do with the line function itself. You’ll need to share a minimal reproducible example for anybody to be of any assistance.