This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -326,12 +326,26 @@ public static LicenseKey ToLicenseKey(this string licenseKeyText)
326326 var refId = parts [ 0 ] ;
327327 var base64 = parts [ 1 ] ;
328328 var jsv = Convert . FromBase64String ( base64 ) . FromUtf8Bytes ( ) ;
329- var key = jsv . FromJsv < LicenseKey > ( ) ;
330329
331- if ( key . Ref != refId )
332- throw new LicenseException ( "The license '{0}' is not assigned to CustomerId '{1}'." . Fmt ( base64 ) ) . Trace ( ) ;
330+ var hold = JsConfig < DateTime > . DeSerializeFn ;
331+ var holdRaw = JsConfig < DateTime > . RawDeserializeFn ;
333332
334- return key ;
333+ try
334+ {
335+ JsConfig < DateTime > . DeSerializeFn = null ;
336+ JsConfig < DateTime > . RawDeserializeFn = null ;
337+ var key = jsv . FromJsv < LicenseKey > ( ) ;
338+
339+ if ( key . Ref != refId )
340+ throw new LicenseException ( "The license '{0}' is not assigned to CustomerId '{1}'." . Fmt ( base64 ) ) . Trace ( ) ;
341+
342+ return key ;
343+ }
344+ finally
345+ {
346+ JsConfig < DateTime > . DeSerializeFn = hold ;
347+ JsConfig < DateTime > . RawDeserializeFn = holdRaw ;
348+ }
335349 }
336350
337351 public static string GetHashKeyToSign ( this LicenseKey key )
You can’t perform that action at this time.
0 commit comments