mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-01-31 00:47:30 +01:00
Fix bug where if no tasks were available, the program could not continue.
This commit is contained in:
parent
204ec203d5
commit
b040419e12
@ -136,6 +136,12 @@ public static class Tranga_Cli
|
|||||||
private static void ExecuteTask(TaskManager taskManager)
|
private static void ExecuteTask(TaskManager taskManager)
|
||||||
{
|
{
|
||||||
TrangaTask[] tasks = taskManager.GetAllTasks();
|
TrangaTask[] tasks = taskManager.GetAllTasks();
|
||||||
|
if (tasks.Length < 1)
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("There are no available Tasks.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
PrintTasks(tasks);
|
PrintTasks(tasks);
|
||||||
|
|
||||||
Console.WriteLine($"Select Task (0-{tasks.Length}):");
|
Console.WriteLine($"Select Task (0-{tasks.Length}):");
|
||||||
@ -151,6 +157,12 @@ public static class Tranga_Cli
|
|||||||
private static void RemoveTask(TaskManager taskManager)
|
private static void RemoveTask(TaskManager taskManager)
|
||||||
{
|
{
|
||||||
TrangaTask[] tasks = taskManager.GetAllTasks();
|
TrangaTask[] tasks = taskManager.GetAllTasks();
|
||||||
|
if (tasks.Length < 1)
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("There are no available Tasks.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
PrintTasks(tasks);
|
PrintTasks(tasks);
|
||||||
|
|
||||||
Console.WriteLine($"Select Task (0-{tasks.Length}):");
|
Console.WriteLine($"Select Task (0-{tasks.Length}):");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user