Skip to content

Commit

Permalink
OP-1363 | Fix NullPointerException on PatientBillEdit (#2089)
Browse files Browse the repository at this point in the history
* fix NullPointerexception

* update src/main/java/org/isf/accounting/gui/PatientBillEdit.java

* remove message bundle added

* remove space added

* fix NullPointerException on edit bill

---------

Co-authored-by: ArnaudFofou <[email protected]>
  • Loading branch information
ArnaudFofou and ArnaudFofou authored Nov 21, 2024
1 parent 7f0556b commit f5eda62
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/isf/accounting/gui/PatientBillEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -845,11 +845,13 @@ private JButton getJButtonTrashPatient() {
jButtonTrashPatient.setPreferredSize(new Dimension(25, 25));
jButtonTrashPatient.setIcon(new ImageIcon("rsc/icons/remove_patient_button.png"));
jButtonTrashPatient.setToolTipText(MessageBundle.getMessage("angal.newbill.removethepatientassociatedwiththisbill.tooltip"));
if (thisBill.getBillPatient() == null) {
jButtonTrashPatient.setEnabled(false);
}
jButtonTrashPatient.addActionListener(actionEvent -> {
// BILL
thisBill.setBillPatient(null);
thisBill.setIsPatient(false);
thisBill.getBillPatient().setCode(0);
thisBill.setPatName(""); //$NON-NLS-1$
thisBill.setAdmission(null);
// INTERFACE
Expand Down Expand Up @@ -895,6 +897,9 @@ private void setJButtonPickPatient() {
jButtonPickPatient.setText(MessageBundle.getMessage("angal.newbill.changepatient.btn"));
jButtonPickPatient.setMnemonic(MessageBundle.getMnemonic("angal.newbill.changepatient.btn.key"));
jButtonPickPatient.setToolTipText(MessageBundle.getMessage("angal.newbill.changethepatientassociatedwiththisbill.tooltip"));
if (jButtonTrashPatient != null) {
jButtonTrashPatient.setEnabled(true);
}
}
}

Expand Down

0 comments on commit f5eda62

Please sign in to comment.