Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
+7
-4
@@ -122,7 +122,10 @@ export class RateContractDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
addRow() {
|
||||
const formValue = this.form.value.addRow!;
|
||||
const formValue = this.form.value.addRow;
|
||||
if (formValue === undefined) {
|
||||
return;
|
||||
}
|
||||
const price = this.math.parseAmount(formValue.price, 2);
|
||||
if (this.product === null || price <= 0) {
|
||||
return;
|
||||
@@ -215,10 +218,10 @@ export class RateContractDetailComponent implements OnInit, AfterViewInit {
|
||||
this.item.date = moment(formModel.date).format('DD-MMM-YYYY');
|
||||
this.item.validFrom = moment(formModel.validFrom).format('DD-MMM-YYYY');
|
||||
this.item.validTill = moment(formModel.validTill).format('DD-MMM-YYYY');
|
||||
if (formModel.account !== null && typeof formModel.account !== 'string') {
|
||||
this.item.vendor = formModel.account!;
|
||||
if (formModel.account && typeof formModel.account !== 'string') {
|
||||
this.item.vendor = formModel.account;
|
||||
}
|
||||
this.item.narration = formModel.narration!;
|
||||
this.item.narration = formModel.narration ?? '';
|
||||
return this.item;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user