Files
MuditaOS/module-apps/application-settings/presenter/system/SARInfoWindowPresenter.cpp
Lefucjusz 7fc6627759 [MOS-783] Fix crash on entering SAR menu
Fix of the issue that entering SAR option
in menu resulted in crash of the phone
due to uncaught exception caused by
invalid path provided.
2023-01-19 16:41:56 +01:00

22 lines
672 B
C++

// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "SARInfoWindowPresenter.hpp"
#include <log/log.hpp>
SARInfoWindowPresenter::SARInfoWindowPresenter(std::unique_ptr<AbstractSARInfoRepository> &&sarInfoRepository)
: sarInfoRepository{std::move(sarInfoRepository)}
{}
std::string SARInfoWindowPresenter::getSarInfo()
{
try {
const auto sarInfoText = sarInfoRepository->getSarInfoText();
return sarInfoText;
}
catch (const std::runtime_error &e) {
LOG_ERROR("Failed to get SAR info text! Error: %s", e.what());
return "";
}
}