B2012-377 Fixed null reference for transition to empty procedure set

This commit is contained in:
John Jenko 2012-12-17 17:04:44 +00:00
parent 6eb479b8fa
commit c121a2fce1

View File

@ -960,7 +960,8 @@ namespace Volian.Controls.Library
} }
else else
toItem = (ItemInfo)cbTranSects.SelectedItem; // didn't select a step. toItem = (ItemInfo)cbTranSects.SelectedItem; // didn't select a step.
linktxt = string.Format("#Link:Transition:{0} <NewID> {1}", listBoxTranFmt.SelectedIndex, toItem.ItemID); if (toItem != null) // this will be null if transition is to a an empty procedure set (sections but no steps)
linktxt = string.Format("#Link:Transition:{0} <NewID> {1}", listBoxTranFmt.SelectedIndex, toItem.ItemID);
} }
// toItem may have been set in the 'Range' selection code above. // toItem may have been set in the 'Range' selection code above.
if (toItem == null && (etm & E_TransUI.SectMenuAny) == E_TransUI.SectMenuAny) if (toItem == null && (etm & E_TransUI.SectMenuAny) == E_TransUI.SectMenuAny)