mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 15:20:54 +00:00
fix: Remaining clang-tidy unchecked optionals (#6979)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <xrpl/basics/contract.h>
|
||||
#include <xrpl/basics/strHex.h>
|
||||
#include <xrpl/beast/unit_test/suite.h>
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
#include <xrpl/core/Job.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/json/json_value.h>
|
||||
@@ -302,7 +303,8 @@ find_paths(
|
||||
Json::Value p;
|
||||
p["Paths"] = path[jss::paths_computed];
|
||||
STParsedJSONObject po("generic", p);
|
||||
paths = po.object->getFieldPathSet(sfPaths);
|
||||
if (po.object)
|
||||
paths = po.object->getFieldPathSet(sfPaths);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,8 +323,20 @@ find_paths_by_element(
|
||||
std::optional<AccountID> const& srcIssuer,
|
||||
std::optional<uint256> const& domain)
|
||||
{
|
||||
// srcElement is optional but is expected to always be present
|
||||
XRPL_ASSERT(
|
||||
srcElement.has_value(), "xrpl::test::jtx::find_paths_by_element::srcElement : nullptr");
|
||||
|
||||
return find_paths(
|
||||
env, src, dst, saDstAmount, saSendMax, srcElement->getPathAsset(), srcIssuer, domain);
|
||||
env,
|
||||
src,
|
||||
dst,
|
||||
saDstAmount,
|
||||
saSendMax,
|
||||
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
||||
srcElement->getPathAsset(),
|
||||
srcIssuer,
|
||||
domain);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user