This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit a6d3711c2d2a48abb67baf9e12dc6ae8f514f165 Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 16 14:54:11 2017 +0100 refs #9094 fix npe --- .../ui/swing/actions/ShowDemandeAction.java | 38 +++++++++++----------- .../actions/OpenGroupedDemandAction.java | 32 +++++++++--------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java index b375c0b..d672138 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java @@ -89,24 +89,24 @@ public class ShowDemandeAction extends AbstractMainUIFaxToMailAction { FaxToMailUser takenBy = email.getTakenBy(); - MailFolder folderWithMustTakeToEditDemand = email.getMailFolder(); - while (folderWithMustTakeToEditDemand.getParent() != null - && folderWithMustTakeToEditDemand.getMustTakeToEditDemand() == null) { - folderWithMustTakeToEditDemand = folderWithMustTakeToEditDemand.getParent(); - } - if (BooleanUtils.isTrue(folderWithMustTakeToEditDemand.getMustTakeToEditDemand())) { - // si le mail est pris par quelqu'un d'autre, le prend-on ou pas ? - if (takenBy != null && !currentUser.equals(takenBy)) { + // si le mail est pris par quelqu'un d'autre, le prend-on ou pas ? + if (takenBy != null && !currentUser.equals(takenBy)) { + MailFolder folderWithMustTakeToEditDemand = email.getMailFolder(); + while (folderWithMustTakeToEditDemand.getParent() != null + && folderWithMustTakeToEditDemand.getMustTakeToEditDemand() == null) { + folderWithMustTakeToEditDemand = folderWithMustTakeToEditDemand.getParent(); + } + if (BooleanUtils.isTrue(folderWithMustTakeToEditDemand.getMustTakeToEditDemand())) { String htmlMessage = String.format( AbstractApplicationUIHandler.CONFIRMATION_FORMAT, t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), t("faxtomail.alert.alreadyTakenBy.help")); int answer = JOptionPane.showConfirmDialog(getHandler().getTopestUI(), - htmlMessage, - t("faxtomail.alert.alreadyTakenBy.title"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE); + htmlMessage, + t("faxtomail.alert.alreadyTakenBy.title"), + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE); // si on annule, on délock if (answer == JOptionPane.CANCEL_OPTION) { @@ -128,14 +128,14 @@ public class ShowDemandeAction extends AbstractMainUIFaxToMailAction { } } + } else { + takeEmail = false; + JOptionPane.showConfirmDialog(getHandler().getTopestUI(), + t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), + t("faxtomail.alert.alreadyTakenBy.title"), + JOptionPane.DEFAULT_OPTION, + JOptionPane.WARNING_MESSAGE); } - } else { - takeEmail = false; - JOptionPane.showConfirmDialog(getHandler().getTopestUI(), - t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), - t("faxtomail.alert.alreadyTakenBy.title"), - JOptionPane.DEFAULT_OPTION, - JOptionPane.WARNING_MESSAGE); } } // le mail est locké, soit on rejette, soit on ouvre en lecture seule, en fonction de la conf du dossier diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/actions/OpenGroupedDemandAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/actions/OpenGroupedDemandAction.java index 375b3cb..aa5b357 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/actions/OpenGroupedDemandAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/actions/OpenGroupedDemandAction.java @@ -85,14 +85,15 @@ public class OpenGroupedDemandAction extends AbstractFaxToMailAction<DemandeUIMo FaxToMailUser takenBy = email.getTakenBy(); - MailFolder folderWithMustTakeToEditDemand = email.getMailFolder(); - while (folderWithMustTakeToEditDemand.getParent() != null - && folderWithMustTakeToEditDemand.getMustTakeToEditDemand() == null) { - folderWithMustTakeToEditDemand = folderWithMustTakeToEditDemand.getParent(); - } - if (BooleanUtils.isTrue(folderWithMustTakeToEditDemand.getMustTakeToEditDemand())) { - // si le mail est pris par quelqu'un d'autre, le prend-on ou pas ? - if (takenBy != null && !currentUser.equals(takenBy)) { + // si le mail est pris par quelqu'un d'autre, le prend-on ou pas ? + if (takenBy != null && !currentUser.equals(takenBy)) { + + MailFolder folderWithMustTakeToEditDemand = email.getMailFolder(); + while (folderWithMustTakeToEditDemand.getParent() != null + && folderWithMustTakeToEditDemand.getMustTakeToEditDemand() == null) { + folderWithMustTakeToEditDemand = folderWithMustTakeToEditDemand.getParent(); + } + if (BooleanUtils.isTrue(folderWithMustTakeToEditDemand.getMustTakeToEditDemand())) { String htmlMessage = String.format( AbstractApplicationUIHandler.CONFIRMATION_FORMAT, t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), @@ -123,14 +124,15 @@ public class OpenGroupedDemandAction extends AbstractFaxToMailAction<DemandeUIMo demandToOpen.setEditable(true); } } + + } else { + takeEmail = false; + JOptionPane.showConfirmDialog(getHandler().getTopestUI(), + t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), + t("faxtomail.alert.alreadyTakenBy.title"), + JOptionPane.DEFAULT_OPTION, + JOptionPane.WARNING_MESSAGE); } - } else { - takeEmail = false; - JOptionPane.showConfirmDialog(getHandler().getTopestUI(), - t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), - t("faxtomail.alert.alreadyTakenBy.title"), - JOptionPane.DEFAULT_OPTION, - JOptionPane.WARNING_MESSAGE); } } // le mail est locké, on ne fait rien -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.