- Sone sone = webInterface.getCore().getSone(soneId, false);
- templateContext.set("sone", sone);
- List<Post> sonePosts = sone.getPosts();
- sonePosts.addAll(webInterface.getCore().getDirectedPosts(sone));
+ Optional<Sone> sone = webInterface.getCore().getSone(soneId);
+ templateContext.set("sone", sone.orNull());
+ templateContext.set("soneId", soneId);
+ if (!sone.isPresent()) {
+ return;
+ }
+ List<Post> sonePosts = sone.get().getPosts();
+ sonePosts.addAll(webInterface.getCore().getDirectedPosts(sone.get().getId()));