mirror of
https://github.com/unode/firefox_decrypt.git
synced 2025-12-16 12:01:52 +01:00
🐛 Handle .decode possibly applied to None
This commit is contained in:
@@ -401,7 +401,10 @@ class NSSProxy:
|
|||||||
# Transparently handle decoding to string when returning a c_char_p
|
# Transparently handle decoding to string when returning a c_char_p
|
||||||
if restype == ct.c_char_p:
|
if restype == ct.c_char_p:
|
||||||
def _decode(result, func, *args):
|
def _decode(result, func, *args):
|
||||||
return result.decode(DEFAULT_ENCODING)
|
try:
|
||||||
|
return result.decode(DEFAULT_ENCODING)
|
||||||
|
except AttributeError:
|
||||||
|
return result
|
||||||
res.errcheck = _decode
|
res.errcheck = _decode
|
||||||
|
|
||||||
setattr(self, "_" + name, res)
|
setattr(self, "_" + name, res)
|
||||||
|
|||||||
Reference in New Issue
Block a user