diff --git a/libs/remixd/src/services/foundryClient.ts b/libs/remixd/src/services/foundryClient.ts index a53ff6cdfc..4fa3cf840b 100644 --- a/libs/remixd/src/services/foundryClient.ts +++ b/libs/remixd/src/services/foundryClient.ts @@ -171,13 +171,15 @@ export class FoundryClient extends PluginClient { const contractName = basename(path).replace('.json', '') let sourcePath = '' - console.log('feedContractArtifactFile', contentJSON) - for (const key in contentJSON.metadata.settings.compilationTarget) { - if (contentJSON.metadata.settings.compilationTarget[key] === contractName) { - sourcePath = key - break + if (contentJSON?.metadata?.settings?.compilationTarget) { + for (const key in contentJSON.metadata.settings.compilationTarget) { + if (contentJSON.metadata.settings.compilationTarget[key] === contractName) { + sourcePath = key + break + } } } + if (!sourcePath) return const currentCache = cache.files[sourcePath]