Skip to content

Commit

Permalink
Merge pull request #3 from LeoLamCY/add-file-list-check
Browse files Browse the repository at this point in the history
add check for empty file list
  • Loading branch information
miltoncandelero authored Dec 26, 2016
2 parents 69288f0 + 91502c5 commit 4da1fd3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
26 changes: 13 additions & 13 deletions Boop/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions Boop/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ private void button1_Click(object sender, EventArgs e)
if (userClickedOK == true)
{
if (OFD.FileNames.Length > 0) {
listView1.Items.Clear();
lvFileList.Items.Clear();
FilesToBoop = OFD.FileNames;
ActiveDir = (Path.GetDirectoryName(FilesToBoop[0]));

foreach (string item in OFD.FileNames)
{
if (ActiveDir == Path.GetDirectoryName(item))
{
listView1.Items.Add(Path.GetFileName(item));
lvFileList.Items.Add(Path.GetFileName(item));
}
else
{
Expand All @@ -111,6 +111,13 @@ private void btnBoop_Click(object sender, EventArgs e)
return;
}

if (lvFileList.Items.Count == 0)
{
MessageBox.Show("Add some files first?", "No files to boop", MessageBoxButtons.OK, MessageBoxIcon.Error);

return;
}

//MURDERING YOUR FIREWALL
//I AM BAD SNEK. MUAHAHAHAHAHA

Expand Down

0 comments on commit 4da1fd3

Please sign in to comment.