fix: replace all direct JSON.parse usages with safe parsing utilities

This commit is contained in:
shubhamsharma9199
2025-11-03 22:54:51 +05:30
parent 59b4739524
commit 7a09215e96
6 changed files with 47 additions and 11 deletions
@@ -15,6 +15,7 @@ import { MatDivider } from '@angular/material/divider';
import { NgIf, NgFor, KeyValuePipe } from '@angular/common';
import { DateFormatPipe } from '../../pipes/date-format.pipe';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
import { safeParseObject } from 'app/core/utils/json';
@Component({
selector: 'mifosx-view-checker-inbox',
@@ -52,7 +53,7 @@ export class ViewCheckerInboxComponent {
) {
this.route.data.subscribe((data: { checkerInboxDetail: any }) => {
this.checkerInboxDetail = data.checkerInboxDetail;
this.jsondata = JSON.parse(this.checkerInboxDetail.commandAsJson);
this.jsondata = safeParseObject<any>(this.checkerInboxDetail.commandAsJson, {});
this.displayJSONData = !_.isEmpty(this.jsondata);
});
}