File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -302,9 +302,12 @@ public static implicit operator RedisChannel(byte[]? key)
302302 {
303303 return Encoding . UTF8 . GetString ( arr ) ;
304304 }
305- catch
305+ catch ( Exception e ) when // Only catch exception throwed by Encoding.UTF8.GetString
306+ ( e is DecoderFallbackException
307+ || e is ArgumentException
308+ || e is ArgumentNullException )
306309 {
307- return BitConverter . ToString ( arr ) ;
310+ return BitConverter . ToString ( arr ) ;
308311 }
309312 }
310313
Original file line number Diff line number Diff line change @@ -299,9 +299,12 @@ public static implicit operator RedisKey(byte[]? key)
299299 {
300300 return Encoding . UTF8 . GetString ( arr , 0 , length ) ;
301301 }
302- catch
302+ catch ( Exception e ) when // Only catch exception throwed by Encoding.UTF8.GetString
303+ ( e is DecoderFallbackException
304+ || e is ArgumentException
305+ || e is ArgumentNullException )
303306 {
304- return BitConverter . ToString ( arr , 0 , length ) ;
307+ return BitConverter . ToString ( arr , 0 , length ) ;
305308 }
306309 }
307310 }
You can’t perform that action at this time.
0 commit comments