Fixed crash of edit wifi trigger

This commit is contained in:
jens 2021-11-07 02:09:09 +01:00
parent 0c646b55fc
commit 31c4f6c1d1

View File

@ -1113,9 +1113,7 @@ public class ActivityManageRule extends Activity
{ {
//edit TimeFrame //edit TimeFrame
if(resultCode == RESULT_OK && ActivityManageTriggerTimeFrame.editedTimeFrameTrigger != null) if(resultCode == RESULT_OK && ActivityManageTriggerTimeFrame.editedTimeFrameTrigger != null)
{
this.refreshTriggerList(); this.refreshTriggerList();
}
else else
Miscellaneous.logEvent("w", "TimeFrameEdit", "No timeframe returned. Assuming abort.", 5); Miscellaneous.logEvent("w", "TimeFrameEdit", "No timeframe returned. Assuming abort.", 5);
} }
@ -1133,8 +1131,11 @@ public class ActivityManageRule extends Activity
{ {
if(resultCode == RESULT_OK) if(resultCode == RESULT_OK)
{ {
newTrigger.setTriggerParameter(data.getBooleanExtra("wifiState", false)); Trigger editedTrigger = new Trigger();
newTrigger.setTriggerParameter2(data.getStringExtra("wifiName")); editedTrigger.setTriggerType(Trigger_Enum.wifiConnection);
editedTrigger.setTriggerParameter(data.getBooleanExtra("wifiState", false));
editedTrigger.setTriggerParameter2(data.getStringExtra("wifiName"));
ruleToEdit.getTriggerSet().set(editIndex, editedTrigger);
this.refreshTriggerList(); this.refreshTriggerList();
} }
} }