Handle failing to read images for OVRTK when they're in use, retry crop print when file in use

This commit is contained in:
Natsumi
2025-10-30 01:34:16 +11:00
parent 3836b9b4ce
commit 515f48a9e4
2 changed files with 35 additions and 6 deletions

View File

@@ -94,15 +94,19 @@ namespace VRCX
{
List<OvrtMessage> messages = [];
byte[] imageBytes;
if(!string.IsNullOrWhiteSpace(image) && File.Exists(image))
byte[] imageBytes = null;
try
{
imageBytes = File.ReadAllBytes(image);
if (!string.IsNullOrWhiteSpace(image) && File.Exists(image))
{
imageBytes = File.ReadAllBytes(image);
}
}
else
catch (Exception ex)
{
imageBytes = _vrcxIcon;
logger.Error(ex, "Failed to read OVRT notification image");
}
imageBytes ??= _vrcxIcon;
if (wristNotification)
{