Skip to content

Commit

Permalink
Fixed various crashes when performing actions with no entries selected
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaifm committed Oct 8, 2020
1 parent e9c2f6b commit dbcf7b4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
25 changes: 20 additions & 5 deletions HIBPOfflineCheck/HIBPOfflineColumnProv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ public async void CheckAll()
{
bulkCheck = true;

if (Host.Database == null || Host.Database.RootGroup == null)
return;

var progressDisplay = new ProgressDisplay();
progressDisplay.Show();

Expand Down Expand Up @@ -397,6 +400,9 @@ public async void CheckAll()

public void ClearAll()
{
if (Host.Database == null || Host.Database.RootGroup == null)
return;

DialogResult dialog = MessageBox.Show("This will remove the HIBP status for all entries in the database. Continue?",
String.Empty, MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

Expand Down Expand Up @@ -427,12 +433,15 @@ public async void OnMenuHIBP(object sender, EventArgs e)
{
bulkCheck = true;

var progressDisplay = new ProgressDisplay();
progressDisplay.Show();

MainForm mainForm = HIBPOfflineCheckExt.Host.MainWindow;
PwEntry[] selectedEntries = mainForm.GetSelectedEntries();

if (selectedEntries == null)
return;

var progressDisplay = new ProgressDisplay();
progressDisplay.Show();

for (int j = 0; j < selectedEntries.Length; j++)
{
PasswordEntry = selectedEntries[j];
Expand All @@ -455,10 +464,13 @@ public async void OnMenuHIBP(object sender, EventArgs e)

public void OnMenuHIBPClear(object sender, EventArgs e)
{
bulkCheck = true;

MainForm mainForm = HIBPOfflineCheckExt.Host.MainWindow;
PwEntry[] selectedEntries = mainForm.GetSelectedEntries();

bulkCheck = true;
if (selectedEntries == null)
return;

foreach (PwEntry pwEntry in selectedEntries)
{
Expand All @@ -475,10 +487,13 @@ public void OnMenuHIBPClear(object sender, EventArgs e)

public void OnMenuHIBPExclude(object sender, EventArgs e)
{
bulkCheck = true;

MainForm mainForm = HIBPOfflineCheckExt.Host.MainWindow;
PwEntry[] selectedEntries = mainForm.GetSelectedEntries();

bulkCheck = true;
if (selectedEntries == null)
return;

foreach (PwEntry pwEntry in selectedEntries)
{
Expand Down
4 changes: 2 additions & 2 deletions HIBPOfflineCheck/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.2.0")]
[assembly: AssemblyFileVersion("1.7.2.0")]
[assembly: AssemblyVersion("1.7.3.0")]
[assembly: AssemblyFileVersion("1.7.3.0")]
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
:
HIBPOfflineCheck:1.7.2.0
HIBPOfflineCheck:1.7.3.0
:

0 comments on commit dbcf7b4

Please sign in to comment.