33// https://github.com/basicx-StrgV/ //
44//--------------------------------------------------//
55using System ;
6- using WGetNET . Models ;
7- using WGetNET . Helper ;
86using System . Collections . Generic ;
7+ using WGetNET . Helper ;
8+ using WGetNET . Models ;
99
1010namespace WGetNET
1111{
@@ -143,15 +143,23 @@ public bool IsEmpty
143143 /// <param name="identifier">The identifier of the package</param>
144144 /// <param name="explicitSource">Indicates if the source was explicitly added.</param>
145145 /// <param name="trustLevel">Trust level of the source.</param>
146- internal WinGetSource ( string name , string arg , Uri ? uri , string type , string identifier , bool explicitSource = false , List < string > ? trustLevel = default , string ? data = null )
146+ internal WinGetSource ( string name , string arg , Uri ? uri , string type , string identifier , bool explicitSource = false , List < string > ? trustLevel = null , string ? data = null )
147147 {
148148 _name = name ;
149149 _arg = arg ;
150150 _uri = uri ;
151151 _type = type ;
152152 _identifier = identifier ;
153153 _explicit = explicitSource ;
154- _trustLevel = trustLevel ;
154+
155+ if ( trustLevel != null )
156+ {
157+ _trustLevel = trustLevel ;
158+ }
159+ else
160+ {
161+ _trustLevel = new List < string > ( ) ;
162+ }
155163
156164 if ( data != null )
157165 {
@@ -218,7 +226,7 @@ public static WinGetSource Create(string name, string identifier, string arg, st
218226
219227 Uri . TryCreate ( arg , UriKind . Absolute , out Uri ? uri ) ;
220228
221- return new WinGetSource ( name , arg , uri , type , identifier , data : data ) ;
229+ return new WinGetSource ( name , arg , uri , type , identifier , data : data ) ;
222230 }
223231
224232 /// <summary>
@@ -232,7 +240,7 @@ internal static WinGetSource FromSourceModel(SourceModel model)
232240 {
233241 Uri . TryCreate ( model . Arg , UriKind . Absolute , out Uri ? uri ) ;
234242
235- return new WinGetSource ( model . Name , model . Arg , uri , model . Type , model . Identifier , model . Explicit , model . TrustLevel , model . Data ) ;
243+ return new WinGetSource ( model . Name , model . Arg , uri , model . Type , model . Identifier , model . Explicit , model . TrustLevel , model . Data ) ;
236244 }
237245
238246 /// <inheritdoc/>
0 commit comments