mirror of https://gitlab.com/bashrc2/epicyon
Handle none inputs
parent
66410d9704
commit
e6fbee9ca8
4
posts.py
4
posts.py
|
@ -133,6 +133,8 @@ def noOfFollowersOnDomain(baseDir: str, handle: str,
|
||||||
def _getLocalPrivateKey(baseDir: str, nickname: str, domain: str) -> str:
|
def _getLocalPrivateKey(baseDir: str, nickname: str, domain: str) -> str:
|
||||||
"""Returns the private key for a local account
|
"""Returns the private key for a local account
|
||||||
"""
|
"""
|
||||||
|
if not domain or not nickname:
|
||||||
|
return None
|
||||||
handle = nickname + '@' + domain
|
handle = nickname + '@' + domain
|
||||||
keyFilename = baseDir + '/keys/private/' + handle.lower() + '.key'
|
keyFilename = baseDir + '/keys/private/' + handle.lower() + '.key'
|
||||||
if not os.path.isfile(keyFilename):
|
if not os.path.isfile(keyFilename):
|
||||||
|
@ -152,6 +154,8 @@ def getInstanceActorKey(baseDir: str, domain: str) -> str:
|
||||||
def _getLocalPublicKey(baseDir: str, nickname: str, domain: str) -> str:
|
def _getLocalPublicKey(baseDir: str, nickname: str, domain: str) -> str:
|
||||||
"""Returns the public key for a local account
|
"""Returns the public key for a local account
|
||||||
"""
|
"""
|
||||||
|
if not domain or not nickname:
|
||||||
|
return None
|
||||||
handle = nickname + '@' + domain
|
handle = nickname + '@' + domain
|
||||||
keyFilename = baseDir + '/keys/public/' + handle.lower() + '.key'
|
keyFilename = baseDir + '/keys/public/' + handle.lower() + '.key'
|
||||||
if not os.path.isfile(keyFilename):
|
if not os.path.isfile(keyFilename):
|
||||||
|
|
Loading…
Reference in New Issue