Исправлены ошибки

This commit is contained in:
Данияр Аглиуллов 2022-10-07 18:37:39 +04:00
parent 56df1b9cb5
commit e31712ac6a

View File

@ -111,7 +111,7 @@
if (form.ShowDialog() == DialogResult.OK)
{
DrawningObject airplane = new(form.SelectedAirplane);
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + airplane)
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + airplane != -1)
{
MessageBox.Show("Объект добавлен");
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
@ -142,7 +142,7 @@
return;
}
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
if (_mapAirplanesCollectionGeneric - pos != -1)
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] - pos != null)
{
MessageBox.Show("Объект удален");
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();