@@ -121,11 +121,13 @@ struct TKikimrData {
121121const TKikimrTableDescription* TKikimrTablesData::EnsureTableExists (const TString& cluster,
122122 const TString& table, TPositionHandle pos, TExprContext& ctx) const
123123{
124- auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
125-
126124 auto tablePath = table;
127- if (tempTableInfoIt != TempTablesState->TempTables .end ()) {
128- tablePath = tempTableInfoIt->first ;
125+ if (TempTablesState) {
126+ auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
127+
128+ if (tempTableInfoIt != TempTablesState->TempTables .end ()) {
129+ tablePath = tempTableInfoIt->first ;
130+ }
129131 }
130132
131133 auto desc = Tables.FindPtr (std::make_pair (cluster, tablePath));
@@ -141,11 +143,13 @@ const TKikimrTableDescription* TKikimrTablesData::EnsureTableExists(const TStrin
141143}
142144
143145TKikimrTableDescription& TKikimrTablesData::GetOrAddTable (const TString& cluster, const TString& database, const TString& table, ETableType tableType) {
144- auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
145-
146146 auto tablePath = table;
147- if (tempTableInfoIt != TempTablesState->TempTables .end ()) {
148- tablePath = tempTableInfoIt->first ;
147+ if (TempTablesState) {
148+ auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
149+
150+ if (tempTableInfoIt != TempTablesState->TempTables .end ()) {
151+ tablePath = tempTableInfoIt->first ;
152+ }
149153 }
150154
151155 if (!Tables.FindPtr (std::make_pair (cluster, tablePath))) {
@@ -165,11 +169,13 @@ TKikimrTableDescription& TKikimrTablesData::GetOrAddTable(const TString& cluster
165169}
166170
167171TKikimrTableDescription& TKikimrTablesData::GetTable (const TString& cluster, const TString& table) {
168- auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
169-
170172 auto tablePath = table;
171- if (tempTableInfoIt != TempTablesState->TempTables .end ()) {
172- tablePath = tempTableInfoIt->first ;
173+ if (TempTablesState) {
174+ auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
175+
176+ if (tempTableInfoIt != TempTablesState->TempTables .end ()) {
177+ tablePath = tempTableInfoIt->first ;
178+ }
173179 }
174180
175181 auto desc = Tables.FindPtr (std::make_pair (cluster, tablePath));
@@ -181,11 +187,13 @@ TKikimrTableDescription& TKikimrTablesData::GetTable(const TString& cluster, con
181187const TKikimrTableDescription& TKikimrTablesData::ExistingTable (const TStringBuf& cluster,
182188 const TStringBuf& table) const
183189{
184- auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
185-
186190 auto tablePath = table;
187- if (tempTableInfoIt != TempTablesState->TempTables .end ()) {
188- tablePath = tempTableInfoIt->first ;
191+ if (TempTablesState) {
192+ auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
193+
194+ if (tempTableInfoIt != TempTablesState->TempTables .end ()) {
195+ tablePath = tempTableInfoIt->first ;
196+ }
189197 }
190198
191199 auto desc = Tables.FindPtr (std::make_pair (TString (cluster), TString (tablePath)));
0 commit comments