Skip to content

Commit 7d2e0f1

Browse files
committed
* Fix rare crash when character set is null or empty
1 parent f4994a4 commit 7d2e0f1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Advanced PassGen/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.5.0.0")]
55-
[assembly: AssemblyFileVersion("1.5.0.0")]
54+
[assembly: AssemblyVersion("1.5.1.0")]
55+
[assembly: AssemblyFileVersion("1.5.1.0")]

Advanced PassGen/Windows/MainWindow.xaml.cs

+6
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ private async void BtnGenerate_Click(object sender, RoutedEventArgs e)
189189
if (TxtAmount.Value == null) return;
190190
if (TxtRandomSeed.Value == null) return;
191191

192+
if (charSet.Length == 0)
193+
{
194+
MessageBox.Show("Character set cannot be empty!", "Advanced PassGen", MessageBoxButton.OK, MessageBoxImage.Error);
195+
return;
196+
}
197+
192198
_generator = new PasswordGenerator(charSet, minValue, maxValue + 1, (int) TxtAmount.Value, (int) TxtRandomSeed.Value);
193199
List<Password> passwords = await _generator.GeneratePasswords();
194200

0 commit comments

Comments
 (0)