From 687a396e9c7581ebc2b35e58fc9b44d20d93a5d3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 25 Aug 2021 20:02:51 -0400 Subject: fix error when reading a duplicate assembly --- src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/SMAPI/Framework/ModLoading/Symbols') diff --git a/src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs b/src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs index 02a70f1c..1b160690 100644 --- a/src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs +++ b/src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs @@ -24,10 +24,11 @@ namespace StardewModdingAPI.Framework.ModLoading.Symbols *********/ /// Add the symbol file for a given assembly name, if it's not already registered. /// The assembly file name. - /// The raw file stream for the symbols. - public void AddSymbolData(string fileName, Stream symbolStream) + /// Get the raw file stream for the symbols. + public void TryAddSymbolData(string fileName, Func getSymbolStream) { - this.SymbolsByAssemblyPath.Add(fileName, symbolStream); + if (!this.SymbolsByAssemblyPath.ContainsKey(fileName)) + this.SymbolsByAssemblyPath.Add(fileName, getSymbolStream()); } /// Get a symbol reader for a given module and assembly name. -- cgit