r2200 - branches/wao-4.0.x/wao-services/src/main/java/fr/ifremer/wao/services/service
Author: bleny Date: 2014-08-06 14:41:53 +0200 (Wed, 06 Aug 2014) New Revision: 2200 Url: http://forge.codelutin.com/projects/wao/repository/revisions/2200 Log: fixes #5585 fix npe when editing a contact without main observer Modified: branches/wao-4.0.x/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java Modified: branches/wao-4.0.x/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java =================================================================== --- branches/wao-4.0.x/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java 2014-08-06 12:33:12 UTC (rev 2199) +++ branches/wao-4.0.x/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java 2014-08-06 12:41:53 UTC (rev 2200) @@ -237,8 +237,11 @@ updateContactCommand.setCreation(false); - String mainObserverId = contact.getMainObserver().getTopiaId(); - updateContactCommand.setMainObserverId(mainObserverId); + if (contact.getMainObserver() != null) { + String mainObserverId = contact.getMainObserver().getTopiaId(); + updateContactCommand.setMainObserverId(mainObserverId); + } + Set<String> secondaryObserversTopiaIds = contact.getSecondaryObserversTopiaIds(); updateContactCommand.setSecondaryObserverIds(secondaryObserversTopiaIds);
participants (1)
-
bleny@users.forge.codelutin.com