File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Jellyfin.Plugin.Webhook/Helpers Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Globalization ;
3- using System . Text . Json . JsonEncodedText ;
43using System . Web ;
54using HandlebarsDotNet ;
5+ using System . Text . Json ;
66
77namespace Jellyfin . Plugin . Webhook . Helpers ;
88
@@ -60,13 +60,16 @@ public static class HandlebarsFunctionHelpers
6060 writer . WriteSafeString ( encodedValue ) ;
6161 } ;
6262
63- private static readonly HandlebarsHelper JsonEncodeHelper = ( writer , context , parameters ) => {
63+ private static readonly HandlebarsHelper JsonEncodeHelper = ( writer , context , parameters ) =>
64+ {
6465 if ( parameters . Length != 1 )
6566 {
6667 throw new HandlebarsException ( "{{json_encode}} helper must have exactly one argument" ) ;
6768 }
6869
6970 var valueToEncode = GetStringValue ( parameters [ 0 ] ) ;
71+ ArgumentNullException . ThrowIfNull ( valueToEncode ) ;
72+
7073 var encodedValue = JsonEncodedText . Encode ( valueToEncode ) . ToString ( ) ;
7174 writer . WriteSafeString ( encodedValue ) ;
7275 } ;
You can’t perform that action at this time.
0 commit comments