chore: explicitly handle null description
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
|
||||
{
|
||||
@@ -42,8 +43,11 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
|
||||
/// <returns>A string with \n replaced by br tags.</returns>
|
||||
public static string FormatDescription(string description)
|
||||
{
|
||||
try
|
||||
if (description == null)
|
||||
{
|
||||
return "Description is null";
|
||||
}
|
||||
|
||||
var maxLength = 500;
|
||||
if (Plugin.Instance != null)
|
||||
{
|
||||
@@ -59,11 +63,6 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
|
||||
|
||||
return description;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return "Error getting description";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get video name from file path on the disk.
|
||||
|
||||
Reference in New Issue
Block a user