Es kam mal den Index -1 und pfad combi ist falsch gewesen

This commit is contained in:
Husky
2018-07-24 10:15:32 +02:00
parent c57ce38aa2
commit dc0824419d

View File

@@ -106,7 +106,7 @@ namespace SanSystem
schacht.SavedBilders.Remove(bild); schacht.SavedBilders.Remove(bild);
pt_box.Image = null; pt_box.Image = null;
pt_box.Dispose(); pt_box.Dispose();
File.Delete(Path.Combine(Global.Instance.Projektpfad, bild.Speicherpfad)); //File.Delete(bild.Speicherpfad);
lb_pictures.DataSource = null; lb_pictures.DataSource = null;
lb_pictures.DataSource = schacht.SavedBilders; lb_pictures.DataSource = schacht.SavedBilders;
} }
@@ -118,6 +118,7 @@ namespace SanSystem
ListBox listBox = (ListBox)sender; ListBox listBox = (ListBox)sender;
if (listBox == null) return; if (listBox == null) return;
int index = listBox.SelectedIndex; int index = listBox.SelectedIndex;
if (index == -1) return;
string pfad = Path.Combine(schacht.SavedBilders[index].Speicherpfad); string pfad = Path.Combine(schacht.SavedBilders[index].Speicherpfad);
if (!File.Exists(pfad)) if (!File.Exists(pfad))