diff --git a/src/domain/analysisView/il2cppMetadataView.ts b/src/domain/analysisView/il2cppMetadataView.ts index a538b18636..02ae1a6751 100644 --- a/src/domain/analysisView/il2cppMetadataView.ts +++ b/src/domain/analysisView/il2cppMetadataView.ts @@ -316,6 +316,8 @@ const parseMetadataReport = ( const reusable = isImmutableJsonSnapshot(report); const cached = reusable ? checkedReports.get(report) : undefined; if (cached !== undefined) return ok(cached); + const rowCount = (collection: Request["collection"]) => + rowsFor(report, collection)?.length ?? null; const methodAddresses = report.binary == null ? undefined : report.method_addresses; const checked = { @@ -334,21 +336,17 @@ const parseMetadataReport = ( events: report.events?.length ?? null, parameters: report.parameters?.length ?? null, string_literals: report.string_literals?.length ?? null, - code_gen_modules: report.binary?.code_gen_modules.length ?? null, + code_gen_modules: rowCount("code_gen_modules"), method_addresses: methodAddresses?.length ?? null, method_address_states: countStates(methodAddresses), - return_types: - report.binary == null ? null : (report.return_types?.length ?? null), - field_types: - report.binary == null ? null : (report.field_types?.length ?? null), - parameter_types: - report.binary == null ? null : (report.parameter_types?.length ?? null), + return_types: rowCount("return_types"), + field_types: rowCount("field_types"), + parameter_types: rowCount("parameter_types"), generic_method_instances: report.generic_method_instances?.length ?? null, generic_method_instance_states: countStates( report.generic_method_instances, ), - generic_method_issues: - report.binary?.generic_methods?.issues.length ?? null, + generic_method_issues: rowCount("generic_method_issues"), }, }; if (reusable) checkedReports.set(report, checked);