Remove the possibility to create images for unknown IDs.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / EditProfilePage.java
index 51a72b8..d814212 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - EditProfilePage.java - Copyright © 2010–2012 David Roden
+ * Sone - EditProfilePage.java - Copyright © 2010–2013 David Roden
  *
  * 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
@@ -82,7 +82,7 @@ public class EditProfilePage extends SoneTemplatePage {
                                profile.setMiddleName(middleName.length() > 0 ? middleName : null);
                                profile.setLastName(lastName.length() > 0 ? lastName : null);
                                profile.setBirthDay(birthDay).setBirthMonth(birthMonth).setBirthYear(birthYear);
-                               profile.setAvatar(webInterface.getCore().getImage(avatarId, false));
+                               profile.setAvatar(webInterface.getCore().getImage(avatarId).orNull());
                                for (Field field : fields) {
                                        String value = request.getHttpRequest().getPartAsStringFailsafe("field-" + field.getId(), 400);
                                        field.setValue(value);