Module id and name can no longer be null

Close #797
This commit is contained in:
topjohnwu 2018-11-25 17:04:23 -05:00
parent 2a9ff9c5ef
commit ddfd42994e

View File

@ -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());
} }