Skip to content

Commit

Permalink
empty vector
Browse files Browse the repository at this point in the history
  • Loading branch information
RayDeeUx authored Dec 12, 2024
1 parent 8b1b96b commit cf392d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PlayLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

class $modify(MyPlayLayer, PlayLayer) {
static std::string grabRandomQuote(std::vector<std::string> vector = manager->quotes) {
if (vector.empty()) return "";
std::mt19937 randomSeed(std::random_device{}());
std::shuffle(vector.begin(), vector.end(), randomSeed);
return vector.front();
Expand Down Expand Up @@ -87,4 +88,4 @@ class $modify(MyPlayLayer, PlayLayer) {
}
}
}
};
};

0 comments on commit cf392d7

Please sign in to comment.