#vulnerable code 
                              private void drawScreenFrame(Graphics2D g2d, int scrId) {
    Rectangle rect = Screen.getBounds(scrId);
    Rectangle ubound = (new ScreenUnion()).getBounds();
    g2d.setColor(screenFrameColor);
    g2d.setStroke(strokeScreenFrame);
    rect.x -= ubound.x;
    rect.y -= ubound.y;
    int sw = (int) (strokeScreenFrame.getLineWidth() / 2);
    rect.x += sw;
    rect.y += sw;
    rect.width -= sw * 2;
    rect.height -= sw * 2;
    g2d.draw(rect);
  } 
                            #location 6 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              private void drawScreenFrame(Graphics2D g2d, int scrId) {
    g2d.setColor(screenFrameColor);
    g2d.setStroke(strokeScreenFrame);
    if (screenFrame == null) {
      screenFrame = Screen.getBounds(scrId);
      Rectangle ubound = scrOCP.getBounds();
      screenFrame.x -= ubound.x;
      screenFrame.y -= ubound.y;
      int sw = (int) (strokeScreenFrame.getLineWidth() / 2);
      screenFrame.x += sw;
      screenFrame.y += sw;
      screenFrame.width -= sw * 2;
      screenFrame.height -= sw * 2;
    }
    g2d.draw(screenFrame);
  }