From ae76ae4025da650dae3ef56eced5afb218711ce8 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 3 Oct 2016 13:46:13 +0800 Subject: [PATCH] Prevent incorrect repo --- .../main/java/com/topjohnwu/magisk/utils/ModuleHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java b/app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java index 63816edbe..eb468e222 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java @@ -92,10 +92,12 @@ public class ModuleHelper { Repo repo = cached.get(id); if (repo == null) { Logger.dev("ModuleHelper: Create new repo " + id); - repoMap.put(id, new Repo(context, name, updatedDate)); + repo = new Repo(context, name, updatedDate); } else { Logger.dev("ModuleHelper: Cached repo " + id); repo.update(updatedDate); + } + if (repo.getId() != null) { repoMap.put(id, repo); } }