Skip to content

Commit

Permalink
Merge pull request openMF#665 from AbhilashG97/android-client-662
Browse files Browse the repository at this point in the history
fix: App crashes on leaving the "Amount Disbursed" field in the Disburse Loan Dialog fragment empty
  • Loading branch information
therajanmaurya authored Apr 13, 2017
2 parents dd5b1b5 + 382e194 commit 543e3e3
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.widget.Toast;

import com.mifos.api.GenericResponse;
import com.mifos.exceptions.RequiredFieldException;
import com.mifos.mifosxdroid.R;
import com.mifos.mifosxdroid.core.MifosBaseActivity;
import com.mifos.mifosxdroid.core.MifosBaseFragment;
Expand Down Expand Up @@ -118,6 +119,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

@OnClick(R.id.btn_disburse_loan)
void onSubmitDisburse() {
// Notify the user if Amount field is blank
if (etDisbursedAmount.getEditableText().toString().isEmpty()) {
new RequiredFieldException(getString(R.string.amount), getString(R.string
.message_field_required)).notifyUserWithToast(getActivity());
return;
}
LoanDisbursement loanDisbursement = new LoanDisbursement();
loanDisbursement.setNote(etDisbursementNote.getEditableText().toString());
loanDisbursement.setActualDisbursementDate(disbursementDates);
Expand Down

0 comments on commit 543e3e3

Please sign in to comment.