fix: Print Invalid Index only if map not empty in UpdateRestaurantStatus()
This commit is contained in:
@@ -282,7 +282,7 @@ void FoodDeliveryController::updateRestaurantStatus() const
|
|||||||
listRestaurants();
|
listRestaurants();
|
||||||
std::cout << "Updated Restaurant " << restaurantIterator->second->getName() << " successfully\n";
|
std::cout << "Updated Restaurant " << restaurantIterator->second->getName() << " successfully\n";
|
||||||
}
|
}
|
||||||
else
|
else if (!restaurantOwner.getRestaurants().empty())
|
||||||
{
|
{
|
||||||
std::cout << "Invalid Index. Cannot update Restaurant status!\n";
|
std::cout << "Invalid Index. Cannot update Restaurant status!\n";
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user