diff --git a/simple/csharp/replace-exception-with-test_after.cs b/simple/csharp/replace-exception-with-test_after.cs index 5ec5f68..8ea0acc 100755 --- a/simple/csharp/replace-exception-with-test_after.cs +++ b/simple/csharp/replace-exception-with-test_after.cs @@ -1,8 +1,8 @@ double GetValueForPeriod(int periodNumber) { - if (periodNumber >= values.Length) + if (periodNumber >= values.Length || periodNumber < 0) { return 0; } return values[periodNumber]; -} \ No newline at end of file +}