Gestion des versions de publisher non trouvées https://tree.taiga.io/project/jr-utily-grog-v3/us/112
Showing
1 changed file
with
8 additions
and
1 deletions
... | @@ -129,6 +129,9 @@ public class PublisherVersionView implements Serializable { | ... | @@ -129,6 +129,9 @@ public class PublisherVersionView implements Serializable { |
129 | PublisherVersion publisherVersion; | 129 | PublisherVersion publisherVersion; |
130 | 130 | ||
131 | publisherVersion = publisherService.getPublisherVersion(publisherVersionId); | 131 | publisherVersion = publisherService.getPublisherVersion(publisherVersionId); |
132 | + if (publisherVersion == null) { | ||
133 | + throw new RuntimeException("Publisher version not found"); | ||
134 | + } | ||
132 | publisherVersionAuthor = publisherVersion.getPublisherVersionAuthor(); | 135 | publisherVersionAuthor = publisherVersion.getPublisherVersionAuthor(); |
133 | publisherVersionDatetime = publisherVersion.getPublisherVersionDatetime(); | 136 | publisherVersionDatetime = publisherVersion.getPublisherVersionDatetime(); |
134 | } | 137 | } |
... | @@ -167,11 +170,15 @@ public class PublisherVersionView implements Serializable { | ... | @@ -167,11 +170,15 @@ public class PublisherVersionView implements Serializable { |
167 | } | 170 | } |
168 | 171 | ||
169 | public void loadData() { | 172 | public void loadData() { |
173 | + PublisherVersion publisherVersion = null; | ||
174 | + | ||
170 | logger.debug("publisherVersionId = {}", this.publisherVersionId); | 175 | logger.debug("publisherVersionId = {}", this.publisherVersionId); |
171 | 176 | ||
172 | if (publisherVersionId != 0) { | 177 | if (publisherVersionId != 0) { |
178 | + publisherVersion = publisherService.getPublisherVersion(publisherVersionId); | ||
179 | + } | ||
173 | 180 | ||
174 | - PublisherVersion publisherVersion = publisherService.getPublisherVersion(publisherVersionId); | 181 | + if (publisherVersion != null) { |
175 | 182 | ||
176 | logger.debug("Found a publisher version : {}", publisherVersion.toString()); | 183 | logger.debug("Found a publisher version : {}", publisherVersion.toString()); |
177 | 184 | ... | ... |
-
Please register or login to post a comment