Author: chatellier Date: 2010-01-22 13:58:33 +0000 (Fri, 22 Jan 2010) New Revision: 2930 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx Log: Fix NPE when creating a new population Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx 2010-01-22 12:49:25 UTC (rev 2929) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx 2010-01-22 13:58:33 UTC (rev 2930) @@ -1,6 +1,6 @@ <!-- /* *##% - * Copyright (C) 2005 - 2009 Ifremer, Code Lutin + * Copyright (C) 2005 - 2010 Ifremer, Code Lutin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -88,9 +88,13 @@ protected void setModel(java.util.List<Zone> availableZones, java.util.List<Zone> selectedZones, JList associatedList){ ZoneListModel zoneModel = new ZoneListModel(availableZones); associatedList.setModel(zoneModel); - for (Zone selectedZone : selectedZones) { - int index = availableZones.indexOf(selectedZone); - associatedList.addSelectionInterval(index, index); + + // can be null at population init + if (selectedZones != null) { + for (Zone selectedZone : selectedZones) { + int index = availableZones.indexOf(selectedZone); + associatedList.addSelectionInterval(index, index); + } } } protected void presenceChanged(){
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org