create new id if null id is set
[jSite2.git] / src / net / pterodactylus / jsite / core / Project.java
index 8bc45dd..9ddada5 100644 (file)
@@ -127,7 +127,11 @@ public class Project extends AbstractBean {
         *            The internal ID
         */
        void setId(String id) {
-               this.id = id;
+               if (id == null) {
+                       this.id = Hex.toHex(IdGenerator.generateId());
+               } else {
+                       this.id = id;
+               }
        }
 
        /**