Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Commit

Permalink
fix: null pointer at new leave info
Browse files Browse the repository at this point in the history
  • Loading branch information
itning committed Jun 4, 2020
1 parent d2d81fd commit d55dfdf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import butterknife.BindView;
import butterknife.ButterKnife;
Expand Down Expand Up @@ -545,7 +547,11 @@ private void handleNewLeave(@NonNull Leave leave, @NonNull TextInputLayout textI
textInputLayout.clearFocus();
editText.clearFocus();
editText.setText("");
leaveList.add(0, restModel.getData());
Leave newLeave = restModel.getData();
if (Objects.isNull(newLeave.getLeaveReasonList())) {
newLeave.setLeaveReasonList(Collections.emptyList());
}
leaveList.add(0, newLeave);
if (newLeaveDialog != null) {
newLeaveDialog.dismiss();
}
Expand Down

0 comments on commit d55dfdf

Please sign in to comment.