Fixed possible KeyNotFoundException

This commit is contained in:
2025-12-13 01:35:21 -07:00
parent 1755fc3504
commit 415e69628d
6 changed files with 14 additions and 4 deletions

View File

@@ -1,5 +1,10 @@
# Changelog # Changelog
[0.3.1]
- Fixed possible `KeyNotFoundException` in C# code due to invalid
dictionary access when an IC housing has an error
[0.3.0] [0.3.0]
- Implemented a multi-pass optimizer - Implemented a multi-pass optimizer

View File

@@ -2,7 +2,7 @@
<ModMetadata xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ModMetadata xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>Slang</Name> <Name>Slang</Name>
<Author>JoeDiertay</Author> <Author>JoeDiertay</Author>
<Version>0.3.0</Version> <Version>0.3.1</Version>
<Description> <Description>
[h1]Slang: High-Level Programming for Stationeers[/h1] [h1]Slang: High-Level Programming for Stationeers[/h1]

View File

@@ -56,6 +56,11 @@ public static class GlobalCode
return false; return false;
} }
if (!sourceMaps[reference].ContainsKey(icErrorLine))
{
return false;
}
var foundRange = sourceMaps[reference][icErrorLine]; var foundRange = sourceMaps[reference][icErrorLine];
if (foundRange is null) if (foundRange is null)

View File

@@ -41,7 +41,7 @@ namespace Slang
{ {
public const string PluginGuid = "com.biddydev.slang"; public const string PluginGuid = "com.biddydev.slang";
public const string PluginName = "Slang"; public const string PluginName = "Slang";
public const string PluginVersion = "0.3.0"; public const string PluginVersion = "0.3.1";
public static Mod MOD = new Mod(PluginName, PluginVersion); public static Mod MOD = new Mod(PluginName, PluginVersion);

View File

@@ -5,7 +5,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AssemblyName>StationeersSlang</AssemblyName> <AssemblyName>StationeersSlang</AssemblyName>
<Description>Slang Compiler Bridge</Description> <Description>Slang Compiler Bridge</Description>
<Version>0.3.0</Version> <Version>0.3.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
</PropertyGroup> </PropertyGroup>

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "slang" name = "slang"
version = "0.3.0" version = "0.3.1"
edition = "2021" edition = "2021"
[workspace] [workspace]