Fix missing names

This commit is contained in:
Norbi Peti 2025-01-13 01:53:03 +01:00
parent c914bc1cb8
commit 5e85e7805e

View file

@ -96,7 +96,7 @@ while (true)
if (!responseJson.HasValue) throw new Exception($"Could not get bot {robot.GetProperty("name")} image"); if (!responseJson.HasValue) throw new Exception($"Could not get bot {robot.GetProperty("name")} image");
var imageBase64 = responseJson.Value.GetProperty("robotImageData").GetString()!; var imageBase64 = responseJson.Value.GetProperty("robotImageData").GetString()!;
File.WriteAllBytes(Path.Combine(dirPath, "image.png"), Convert.FromBase64String(imageBase64)); File.WriteAllBytes(Path.Combine(dirPath, "image.png"), Convert.FromBase64String(imageBase64));
Console.WriteLine($"Saved {robot.GetProperty("name")}"); Console.WriteLine($"Saved {robot.GetProperty("name").GetString() ?? "<unnamed>"}");
Thread.Sleep(100); Thread.Sleep(100);
} }