Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit 4829273

Browse files
committed
Merge branch 'quick-fixes' into development
2 parents fde5d58 + 92ce3a2 commit 4829273

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Graph.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ std::string Graph::printIncidenceMatrix() {
2323
std::string output = getName();
2424
std::string temp = "";
2525

26+
if (incidenceMatrix.size() == 0) {
27+
output = "Graf pusty!";
28+
return output;
29+
}
30+
2631
output += "\n K\\W ||"; //lewy gorny rog ma ' K\W ||', podwojny | dla wyroznienia komorki
2732

2833
// wypisz pierwsza linijke
@@ -79,6 +84,11 @@ std::string Graph::printAdjacencyList() {
7984
std::string output = getName();
8085
std::string temp = "";
8186

87+
if (adjacencyList.size() == 0) {
88+
output = "Graf pusty!";
89+
return output;
90+
}
91+
8292
output += "\n W || wierzcholek konca krawedzi, waga | kolejna... | ...\n"; // pierwsza linijka
8393

8494
// druga linijka rozdzielajaca

Program.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ void Program::start() {
119119

120120
} while (option2 != '0');
121121

122+
delete graph;
123+
122124
} while (option != '0');
123125
}
124126

0 commit comments

Comments
 (0)