Fixed RuleConfig crash when no intent

This commit is contained in:
PeratX 2017-05-30 09:12:10 +08:00
parent 5346e21faa
commit 443eda1642

View File

@ -178,7 +178,11 @@ public class RuleConfigFragment extends ConfigFragment {
ruleImportBuildIn.setValue("0");
id = intent.getIntExtra(ConfigActivity.LAUNCH_ACTION_ID, ConfigActivity.ID_NONE);
if (intent != null) {
id = intent.getIntExtra(ConfigActivity.LAUNCH_ACTION_ID, ConfigActivity.ID_NONE);
} else {
id = ConfigActivity.ID_NONE;
}
Rule rule;
if (id != ConfigActivity.ID_NONE && (rule = Rule.getRuleById(String.valueOf(id))) != null) {
Rule.getRuleById(String.valueOf(id));