Verified Commit 9fef8b06 authored by Kevin Morris's avatar Kevin Morris
Browse files

fix(rpc): fix search arg check



When by == 'maintainer', we allow an unspecified keyword,
resulting in a search of orphan packages. Fix our search
check so that when no arg is given, it is set to an empty
str().

We already check for valid args when type is not maintainer,
so there's no need to worry about other args falling through.

Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent af2f3694
......@@ -200,8 +200,8 @@ class RPC:
if by != "m" and not len(args):
raise RPCError("No request type/data specified.")
arg = args[0]
if len(arg) < 2:
arg = args[0] if args else str()
if by != "m" and len(arg) < 2:
raise RPCError("Query arg too small.")
search = RPCSearch()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment