File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,14 @@ def is_bencoded(x: bytes) -> bool:
51
51
"""
52
52
Returns True is x appears to be valid bencoded byte string.
53
53
"""
54
- return bdecode (x ) is not None
54
+ if not isinstance (x , bytes ):
55
+ msg = f'Expected bytes, got { type (x ).__name__ } '
56
+ raise TypeError (msg )
57
+ try :
58
+ decoded = bdecode (x )
59
+ except RuntimeError :
60
+ decoded = None
61
+ return decoded is not None
55
62
56
63
57
64
class TriblerTunnelSettings (HiddenTunnelSettings ):
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ export class TriblerService {
294
294
295
295
async setSettings ( settings : Partial < Settings > ) : Promise < undefined | ErrorDict | boolean > {
296
296
try {
297
- this . guiSettings = { ...settings ?. ui , ...this . guiSettings } ;
297
+ this . guiSettings = { ...this . guiSettings , ...settings ?. ui } ;
298
298
return ( await this . http . post ( '/settings' , settings ) ) . data . modified ;
299
299
} catch ( error ) {
300
300
return formatAxiosError ( error as Error | AxiosError ) ;
You can’t perform that action at this time.
0 commit comments