Commit ddfd4299 authored by topjohnwu's avatar topjohnwu

Module id and name can no longer be null

Close #797
parent 2a9ff9c5
...@@ -18,12 +18,12 @@ public class Module extends BaseModule { ...@@ -18,12 +18,12 @@ public class Module extends BaseModule {
mDisableFile = new SuFile(path, "disable"); mDisableFile = new SuFile(path, "disable");
mUpdateFile = new SuFile(path, "update"); mUpdateFile = new SuFile(path, "update");
if (getId() == null) { if (getId().isEmpty()) {
int sep = path.lastIndexOf('/'); int sep = path.lastIndexOf('/');
setId(path.substring(sep + 1)); setId(path.substring(sep + 1));
} }
if (getName() == null) { if (getName().isEmpty()) {
setName(getId()); setName(getId());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment