Skip to content

Commit fe759f6

Browse files
author
Peter Oettig
committed
fix: pass generate could have empty location
1 parent 3e554a1 commit fe759f6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ def handleTriggerQuery(self, query):
7878
self.showPasswords(query)
7979

8080
def generatePassword(self, query):
81-
location = query.string.strip()[9:]
81+
location = query.string.strip()[9:].strip()
82+
if not location:
83+
query.add(
84+
StandardItem(
85+
id="generate_password",
86+
icon_factory=lambda: Plugin.makeIcon(self),
87+
text="Can't generate a new password",
88+
subtext="The location for the new password is invalid",
89+
)
90+
)
91+
return
8292

8393
query.add(
8494
StandardItem(

0 commit comments

Comments
 (0)