Skip to content

Commit d233e33

Browse files
author
Peter Oettig
committed
fix: pass generate could have empty location
1 parent 4b1584e commit d233e33

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
@@ -114,7 +114,17 @@ def handleTriggerQuery(self, query):
114114
self.showPasswords(query)
115115

116116
def generatePassword(self, query):
117-
location = query.string.strip()[9:]
117+
location = query.string.strip()[9:].strip()
118+
if not location:
119+
query.add(
120+
StandardItem(
121+
id="generate_password",
122+
icon_factory=lambda: Plugin.makeIcon(self),
123+
text="Can't generate a new password",
124+
subtext="The location for the new password is invalid",
125+
)
126+
)
127+
return
118128

119129
query.add(
120130
StandardItem(

0 commit comments

Comments
 (0)