From 8c7bfd97117ef46093f368d2246346f53ba40cc9 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Mon, 4 Apr 2022 19:05:37 +0300 Subject: [PATCH] fix crash when duplicating templates due to duplicating UUIDs --- .../main/java/net/ktnx/mobileledger/db/TemplateHeader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/db/TemplateHeader.java b/app/src/main/java/net/ktnx/mobileledger/db/TemplateHeader.java index 87ea4fd8..994c3309 100644 --- a/app/src/main/java/net/ktnx/mobileledger/db/TemplateHeader.java +++ b/app/src/main/java/net/ktnx/mobileledger/db/TemplateHeader.java @@ -1,5 +1,5 @@ /* - * Copyright © 2021 Damyan Ivanov. + * Copyright © 2022 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -219,6 +219,8 @@ public class TemplateHeader extends TemplateBase { public TemplateHeader createDuplicate() { TemplateHeader dup = new TemplateHeader(this); dup.id = 0; + dup.uuid = UUID.randomUUID() + .toString(); return dup; } -- 2.39.5