C# Unhandled exception Loops lab example #2

After entering a few numbers and pressing enter to get the results I get the following error…

Enter a number (or ‘ok’ to exit): 5
Enter a number (or ‘ok’ to exit): 6
Enter a number (or ‘ok’ to exit): 4
Enter a number (or ‘ok’ to exit): 6
Enter a number (or ‘ok’ to exit):
Unhandled exception. System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
at System.Convert.ToInt32(String value)
at CSharp_Labs.Program.Main(String[] args) in C:\Users\tkelley\Source\Repos\CSharp-Labs\CSharp-Labs\Program.cs:line 19

You are supposed to enter a number or “ok” but you entered nothing or space(s). The FormatException is the expected error if you give Convert.ToInt32 a string that can not be converted to an integer.

Don’t worry about that (yet). The lectures are about loops and only loops so you should focus on loops there.

Ok, I will not worry about it, but my OCD was kicking in and I was trying to figure it out.

Thanks