Conditioning the sketch on finding the COM port trouble

Change above to:

myPort = new Serial(this, Serial.list()[0], 115200);

Reference:
Variable Scope / Examples / Processing.org