@@ -410,16 +410,19 @@ func (mt *MirrorTarget) openOrCreateTicket(ctx context.Context, ticketBytes []by
410410 var pendingNote * note.Note
411411 userTicketValid := false
412412
413- ticketCP , err := mt .open (ticketBytes )
414- if err != nil {
415- slog .DebugContext (ctx , "Failed to open ticket" , slog .Any ("error" , err ))
416- } else {
417- pendingCP , _ , pendingNote , err = log .ParseCheckpoint (ticketCP , mt .logVerifier .Name (), mt .logVerifier )
413+ var ticketCP []byte
414+ if len (ticketBytes ) > 0 {
415+ ticketCP , err = mt .open (ticketBytes )
418416 if err != nil {
419- slog .DebugContext (ctx , "Failed to parse ticket" , slog .Any ("error" , err ))
417+ slog .DebugContext (ctx , "Failed to open ticket" , slog .Any ("error" , err ))
420418 } else {
421- slog .DebugContext (ctx , "Valid ticket" , slog .Uint64 ("nextEntry" , nextEntry ), slog .Uint64 ("pendingSize" , pendingCP .Size ))
422- userTicketValid = true
419+ pendingCP , _ , pendingNote , err = log .ParseCheckpoint (ticketCP , mt .logVerifier .Name (), mt .logVerifier )
420+ if err != nil {
421+ slog .DebugContext (ctx , "Failed to parse ticket" , slog .Any ("error" , err ))
422+ } else {
423+ slog .DebugContext (ctx , "Valid ticket" , slog .Uint64 ("nextEntry" , nextEntry ), slog .Uint64 ("pendingSize" , pendingCP .Size ))
424+ userTicketValid = true
425+ }
423426 }
424427 }
425428
0 commit comments