Skip to content

Commit

Permalink
prevent null values for additional first names. issue #2073
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Jan 9, 2024
1 parent 0ca33f1 commit 46976b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3344,7 +3344,7 @@ private void cmdNewSmsWithEncryptionPasswordActionPerformed(java.awt.event.Actio

private void cmdCopyAddressToClipboardActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdCopyAddressToClipboardActionPerformed

AddressUtils.copyToClipboard(this.txtCompany.getText(), txtDepartment.getText(), this.cmbTitleInAddress.getEditor().getItem().toString(), this.cmbDegreePrefix.getEditor().getItem().toString(), this.txtFirstName.getText() + " " + this.txtFirstName2.getText(), this.txtName.getText(), this.cmbDegreeSuffix.getEditor().getItem().toString(), this.txtStreet.getText(), this.txtStreetNr.getText(), this.txtAdjunct.getText(), this.txtZipCode.getText(), this.txtCity.getText(), this.txtDistrict.getText(), this.cmbCountry.getEditor().getItem().toString());
AddressUtils.copyToClipboard(this.txtCompany.getText(), txtDepartment.getText(), this.cmbTitleInAddress.getEditor().getItem().toString(), this.cmbDegreePrefix.getEditor().getItem().toString(), this.txtFirstName.getText(), this.txtFirstName2.getText(), this.txtName.getText(), this.cmbDegreeSuffix.getEditor().getItem().toString(), this.txtStreet.getText(), this.txtStreetNr.getText(), this.txtAdjunct.getText(), this.txtZipCode.getText(), this.txtCity.getText(), this.txtDistrict.getText(), this.cmbCountry.getEditor().getItem().toString());

}//GEN-LAST:event_cmdCopyAddressToClipboardActionPerformed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ You should also get your employer (if you work as a programmer) or school,
*/
public class AddressUtils {

public static void copyToClipboard(String company, String department, String titleInAddress, String degreePrefix, String firstName, String name, String degreeSuffix, String street, String streetNr, String adjunct, String zipCode, String city, String district, String country) {
public static void copyToClipboard(String company, String department, String titleInAddress, String degreePrefix, String firstName, String firstName2, String name, String degreeSuffix, String street, String streetNr, String adjunct, String zipCode, String city, String district, String country) {
StringBuilder sb = new StringBuilder();
if (!StringUtils.isEmpty(company)) {
sb.append(company).append(System.lineSeparator());
Expand All @@ -695,6 +695,10 @@ public static void copyToClipboard(String company, String department, String tit
if (!StringUtils.isEmpty(firstName)) {
sb.append(firstName).append(" ");
}

if (!StringUtils.isEmpty(firstName2)) {
sb.append(firstName2).append(" ");
}

if (!StringUtils.isEmpty(name)) {
sb.append(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ private void lblAddressMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:

private void mnuCopyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuCopyActionPerformed
if(this.a!=null) {
AddressUtils.copyToClipboard(a.getCompany(), a.getDepartment(), a.getTitleInAddress(), a.getDegreePrefix(), a.getFirstName() + " " + a.getFirstName2(), a.getName(), a.getDegreeSuffix(), a.getStreet(), a.getStreetNumber(), a.getAdjunct(), a.getZipCode(), a.getCity(), a.getDistrict(), a.getCountry());
AddressUtils.copyToClipboard(a.getCompany(), a.getDepartment(), a.getTitleInAddress(), a.getDegreePrefix(), a.getFirstName(), a.getFirstName2(), a.getName(), a.getDegreeSuffix(), a.getStreet(), a.getStreetNumber(), a.getAdjunct(), a.getZipCode(), a.getCity(), a.getDistrict(), a.getCountry());
}
}//GEN-LAST:event_mnuCopyActionPerformed

Expand Down

0 comments on commit 46976b7

Please sign in to comment.