Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user