diff --git a/Artemis/Artemis/Controls/Log/LoggingControl.xaml b/Artemis/Artemis/Controls/Log/LoggingControl.xaml
index b1ded7610..85c8b6ff9 100644
--- a/Artemis/Artemis/Controls/Log/LoggingControl.xaml
+++ b/Artemis/Artemis/Controls/Log/LoggingControl.xaml
@@ -16,8 +16,8 @@
-
-
+
+
diff --git a/Artemis/Artemis/Controls/Log/LoggingControl.xaml.cs b/Artemis/Artemis/Controls/Log/LoggingControl.xaml.cs
index cf771ba2d..6809192cf 100644
--- a/Artemis/Artemis/Controls/Log/LoggingControl.xaml.cs
+++ b/Artemis/Artemis/Controls/Log/LoggingControl.xaml.cs
@@ -28,7 +28,7 @@ namespace Artemis.Controls.Log
await Dispatcher.InvokeAsync(() =>
{
if (LogCollection.Count >= 50)
- LogCollection.RemoveAt(LogCollection.Count - 1);
+ LogCollection.RemoveAt(0);
LogCollection.Add(message);
});
diff --git a/Artemis/Artemis/Profiles/Lua/LuaWrapper.cs b/Artemis/Artemis/Profiles/Lua/LuaWrapper.cs
index aa65ba722..284a74c94 100644
--- a/Artemis/Artemis/Profiles/Lua/LuaWrapper.cs
+++ b/Artemis/Artemis/Profiles/Lua/LuaWrapper.cs
@@ -97,12 +97,18 @@ namespace Artemis.Profiles.Lua
LuaKeyboardWrapper?.Dispose();
LuaKeyboardWrapper = null;
- LuaScript.Globals.Clear();
- LuaScript.Registry.Clear();
- LuaScript.Registry.RegisterConstants();
- LuaScript.Registry.RegisterCoreModules(CoreModules.Preset_SoftSandbox);
- LuaScript.Globals.RegisterConstants();
- LuaScript.Globals.RegisterCoreModules(CoreModules.Preset_SoftSandbox);
+ try
+ {
+ LuaScript.Registry.RegisterConstants();
+ LuaScript.Registry.RegisterCoreModules(CoreModules.Preset_SoftSandbox);
+ LuaScript.Globals.RegisterConstants();
+ LuaScript.Globals.RegisterCoreModules(CoreModules.Preset_SoftSandbox);
+ }
+ catch (NullReferenceException)
+ {
+ // Can be missing if the user script screwed up the globals
+ }
+
}
}