diff --git a/lib/processors/resourceListCreator.js b/lib/processors/resourceListCreator.js index 3172d99b2..d01eb2182 100644 --- a/lib/processors/resourceListCreator.js +++ b/lib/processors/resourceListCreator.js @@ -217,17 +217,20 @@ class ResourcesList { // search for a resource with the same name let myInfo = this.resourcesByName.get(relativeName); + if ( myInfo == null ) { + // when not found, check if the given resource is a debug resource and share the information with the non-dbg version + const nondbg = ResourcesList.getNonDebugName(relativeName); + if ( nondbg != null && this.resourcesByName.has(nondbg) ) { + myInfo = new ResourceInfo(relativeName); + myInfo.copyFrom(this.name, this.resourcesByName.get(nondbg)); + this.resources.push(myInfo); + this.resourcesByName.set(relativeName, myInfo); + } + } + // this is the assumption, that the debug one is the same as the non-dbg one if ( myInfo == null ) { myInfo = new ResourceInfo(relativeName); - const nonDebugName = ResourcesList.getNonDebugName(relativeName); - // when not found, check if the given resource is a debug resource and - // share the information with the non-dbg version - if ( nonDebugName != null && this.resourcesByName.has(nonDebugName)) { - const nonDbgResource = this.resourcesByName.get(nonDebugName); - myInfo.module = nonDbgResource.module; - myInfo.format = nonDbgResource.format; - } myInfo.size = info.size; this.resources.push(myInfo); this.resourcesByName.set(relativeName, myInfo);