leeres plottyfile wirft exception

This commit is contained in:
Tristan Krause 2019-06-07 11:02:46 +02:00
parent 198feef12f
commit 22a5b466db
7 changed files with 492 additions and 1 deletions

View file

@ -146,6 +146,9 @@ void PlottyFile::prepStr(std::string& str, uint8_t len)
void PlottyFile::writeToFile(std::string filename)
{
if(dots.empty())
throw std::length_error("Es wurden keine Punkte gespeichert.");
prepStr(unit_x, STR_LEN_SHORT);
prepStr(desc_x, STR_LEN_LARGE);
prepStr(unit_y, STR_LEN_SHORT);