Skip to content

Commit

Permalink
null check dynamic casts
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson authored and marta-lokhova committed Nov 21, 2024
1 parent 1f5ab3e commit bdd99db
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnAccountSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ class BulkLoadAccountsOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnClaimableBalanceSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class BulkLoadClaimableBalanceOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnConfigSettingSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class bulkLoadConfigSettingsOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnContractCodeSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class BulkLoadContractCodeOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnContractDataSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class BulkLoadContractDataOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnDataSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ class BulkLoadDataOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnLiquidityPoolSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class BulkLoadLiquidityPoolOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnOfferSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ class BulkLoadOffersOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnTTLSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class BulkLoadTTLOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down
1 change: 1 addition & 0 deletions src/ledger/LedgerTxnTrustLineSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ class BulkLoadTrustLinesOperation
}
auto sqliteStatement =
dynamic_cast<soci::sqlite3_statement_backend*>(be);
releaseAssertOrThrow(sqliteStatement);
auto st = sqliteStatement->stmt_;

sqlite3_reset(st);
Expand Down

0 comments on commit bdd99db

Please sign in to comment.