diff --git a/zaaReloaded2/Formatter/Formatter.cs b/zaaReloaded2/Formatter/Formatter.cs index 86fae29..cb2724f 100755 --- a/zaaReloaded2/Formatter/Formatter.cs +++ b/zaaReloaded2/Formatter/Formatter.cs @@ -64,6 +64,12 @@ namespace zaaReloaded2.Formatter /// public Dictionary WorkingTimePoints { get; private set; } + /// + /// Is true if this Formatter object carries a Laboratory with + /// at least one time point. + /// + public bool CanRun { get { return Laboratory.TimePoints.Count > 0; } } + #endregion #region Constructors @@ -113,6 +119,8 @@ namespace zaaReloaded2.Formatter /// current position of the cursor). public void Run() { + if (!CanRun) throw new InvalidOperationException("No laboratory data to format."); + int current = 0; while (current < Settings.Elements.Count) {