Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.

Fixed the errors it threw up.
This commit is contained in:
2022-07-17 09:17:20 +05:30
parent c76696e022
commit 9f70ec2917
29 changed files with 144 additions and 111 deletions

View File

@ -201,7 +201,10 @@ export class PurchaseComponent implements OnInit, AfterViewInit, OnDestroy {
}
addRow() {
const formValue = this.form.value.addRow!;
const formValue = this.form.value.addRow;
if (formValue === undefined) {
return;
}
const quantity = this.math.parseAmount(formValue.quantity, 2);
if (this.product === null || quantity <= 0) {
return;
@ -332,7 +335,7 @@ export class PurchaseComponent implements OnInit, AfterViewInit, OnDestroy {
if (formModel.account !== null && typeof formModel.account !== 'string') {
this.voucher.vendor = formModel.account;
}
this.voucher.narration = formModel.narration!;
this.voucher.narration = formModel.narration ?? '';
return this.voucher;
}