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