summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/Symbols
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-25 20:02:51 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-25 20:02:51 -0400
commit687a396e9c7581ebc2b35e58fc9b44d20d93a5d3 (patch)
treeb1136efc6b4a8674c9f7adb2a44eb691668fae9d /src/SMAPI/Framework/ModLoading/Symbols
parent0b29eb3bc37553aa2e9776e17727ba07018606ea (diff)
downloadSMAPI-687a396e9c7581ebc2b35e58fc9b44d20d93a5d3.tar.gz
SMAPI-687a396e9c7581ebc2b35e58fc9b44d20d93a5d3.tar.bz2
SMAPI-687a396e9c7581ebc2b35e58fc9b44d20d93a5d3.zip
fix error when reading a duplicate assembly
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/Symbols')
-rw-r--r--src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs7
1 files changed, 4 insertions, 3 deletions
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
*********/
/// <summary>Add the symbol file for a given assembly name, if it's not already registered.</summary>
/// <param name="fileName">The assembly file name.</param>
- /// <param name="symbolStream">The raw file stream for the symbols.</param>
- public void AddSymbolData(string fileName, Stream symbolStream)
+ /// <param name="getSymbolStream">Get the raw file stream for the symbols.</param>
+ public void TryAddSymbolData(string fileName, Func<Stream> getSymbolStream)
{
- this.SymbolsByAssemblyPath.Add(fileName, symbolStream);
+ if (!this.SymbolsByAssemblyPath.ContainsKey(fileName))
+ this.SymbolsByAssemblyPath.Add(fileName, getSymbolStream());
}
/// <summary>Get a symbol reader for a given module and assembly name.</summary>