Author: kmorin Date: 2013-03-05 13:48:12 +0100 (Tue, 05 Mar 2013) New Revision: 543 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/543 Log: last minute bug fix Modified: tags/tutti-1.0.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java Modified: tags/tutti-1.0.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java =================================================================== --- tags/tutti-1.0.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-03-05 12:42:52 UTC (rev 542) +++ tags/tutti-1.0.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-03-05 12:48:12 UTC (rev 543) @@ -10,15 +10,15 @@ * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the + * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public + * + * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% @@ -454,12 +454,15 @@ HydrologyTabUI hydrologyTab = ui.getHydrologyTabContent(); hydrologyTab.getHandler().reset(bean); - Integer objectId = Integer.valueOf(editFishingOperationUIModel.getObjectId()); + String id = editFishingOperationUIModel.getObjectId(); + if (id != null) { + Integer objectId = Integer.valueOf(id); - List<Attachment> attachments = - getContext().getPersistenceService().getAllAttachments(objectId); + List<Attachment> attachments = + getContext().getPersistenceService().getAllAttachments(objectId); - editFishingOperationUIModel.addAllAttachment(attachments); + editFishingOperationUIModel.addAllAttachment(attachments); + } editFishingOperationUIModel.setModify(false); handler.getFishingOperationMonitor().clearModified();