From 48e335cd045147c940f82f9986b0e83966a869d0 Mon Sep 17 00:00:00 2001 From: ljacobsson Date: Tue, 29 Aug 2023 10:40:09 +0200 Subject: [PATCH] [samp local] fixing RemainingTimeInMilliseconds issue --- .../local/runtime-support/dotnet/LambdaContext.cs | 2 +- src/commands/local/runtime-support/dotnet/Program.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/commands/local/runtime-support/dotnet/LambdaContext.cs b/src/commands/local/runtime-support/dotnet/LambdaContext.cs index 288144a..325a39c 100644 --- a/src/commands/local/runtime-support/dotnet/LambdaContext.cs +++ b/src/commands/local/runtime-support/dotnet/LambdaContext.cs @@ -13,5 +13,5 @@ internal class LambdaContext : ILambdaContext public string LogGroupName { get; set; } public string LogStreamName { get; set; } public int MemoryLimitInMB { get; set; } - public TimeSpan RemainingTime { get; set; } = TimeSpan.MaxValue; + public TimeSpan RemainingTime { get; set; } = TimeSpan.FromMinutes(10); } \ No newline at end of file diff --git a/src/commands/local/runtime-support/dotnet/Program.cs b/src/commands/local/runtime-support/dotnet/Program.cs index 0e25d4b..26e3211 100644 --- a/src/commands/local/runtime-support/dotnet/Program.cs +++ b/src/commands/local/runtime-support/dotnet/Program.cs @@ -162,7 +162,14 @@ static void InvokeFunctionThread(object? data) } catch (Exception ex) { - File.WriteAllText(responsesDir, ex.Message); + if (!ex.Message.Contains("(Object reference not set to an instance of an object.)")) + { + File.WriteAllText(responsesDir, ex.Message); + } + else + { + File.WriteAllText(responsesDir, "null"); + } return; }