diff options
author | aleksandra-zh <aleksandra-zh@yandex-team.com> | 2024-10-08 12:31:10 +0300 |
---|---|---|
committer | aleksandra-zh <aleksandra-zh@yandex-team.com> | 2024-10-08 13:10:07 +0300 |
commit | 89ada4e9c8b6002357b32fe1c8767fc4c4d3963e (patch) | |
tree | 51bc2795c2a23377931ae1c92fff49395f8c510b | |
parent | c4b82497e0df7b5f7bbb96242684945bf07f5509 (diff) | |
download | ydb-89ada4e9c8b6002357b32fe1c8767fc4c4d3963e.tar.gz |
YT-23044: Fix loading error with no attributes
commit_hash:54923dc09457342bb6e6a2799cb9d7c6d41f1842
-rw-r--r-- | yt/yt/core/misc/error.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/yt/yt/core/misc/error.cpp b/yt/yt/core/misc/error.cpp index cc5fcbf7a4..8aff91e407 100644 --- a/yt/yt/core/misc/error.cpp +++ b/yt/yt/core/misc/error.cpp @@ -172,14 +172,16 @@ TOriginAttributes ExtractFromDictionaryOverride(const NYTree::IAttributeDictiona TExtensionData ext; - static const TString FidKey("fid"); - ext.Fid = attributes->GetAndRemove<NConcurrency::TFiberId>(FidKey, NConcurrency::InvalidFiberId); + if (attributes) { + static const TString FidKey("fid"); + ext.Fid = attributes->GetAndRemove<NConcurrency::TFiberId>(FidKey, NConcurrency::InvalidFiberId); - static const TString TraceIdKey("trace_id"); - ext.TraceId = attributes->GetAndRemove<NTracing::TTraceId>(TraceIdKey, NTracing::InvalidTraceId); + static const TString TraceIdKey("trace_id"); + ext.TraceId = attributes->GetAndRemove<NTracing::TTraceId>(TraceIdKey, NTracing::InvalidTraceId); - static const TString SpanIdKey("span_id"); - ext.SpanId = attributes->GetAndRemove<NTracing::TSpanId>(SpanIdKey, NTracing::InvalidSpanId); + static const TString SpanIdKey("span_id"); + ext.SpanId = attributes->GetAndRemove<NTracing::TSpanId>(SpanIdKey, NTracing::InvalidSpanId); + } result.ExtensionData = Encode(ext); return result; |