NullPointerException on array through serial monitor

I have code with the Processing project connected to an Arduino project through the Serial Port. The Processing program keeps giving me a NullPointerException on line 26. I need help on fixing this problem. PROCESSING CODE:

void setup(){
  size(500,500);
  String portName = Serial.list()[0];
  myPort = new Serial(this,portName,9600);
  myPort.bufferUntil('\n');
}
void serialEvent(Serial myPort){
  String inputString = myPort.readStringUntil('\n');
  inputString = trim(inputString);
  int inputButtons[] = int(split(inputString,','));
  append(buttonValues,inputButtons[0]);
  append(buttonValues,inputButtons[1]);
}
void draw(){
  fill(0,0,0);
  textSize(20);
  potValue = buttonValues[0];
  buttonSt = buttonValues[1];
  
  
}

ARDUINO CODE:

int potCtrlPin = A2;
int potVal;
int timerP = 0; 
int buttonPin = 2;
int buttonState;
int buttonPressed;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  timerP+=1;
  // put your main code here, to run repeatedly:
  potVal = analogRead(potCtrlPin);
  buttonState = digitalRead(buttonPin);
  if(buttonState == HIGH){
   buttonPressed = 0; 
  }
  if(buttonState == LOW){
   buttonPressed = 1; 
  }
  Serial.print(potVal);
  Serial.print(",");
  Serial.print(buttonPressed);
}

The Processing program keeps giving me a NullPointerException on line 26.

Your Processing program only has 21 lines.