Skip to content

Commit

Permalink
[Coverity] #1840581 catch std::bad_function_call
Browse files Browse the repository at this point in the history
Catch a possible `std::bad_function_call` exception that can be thrown
by `Tensor::getData()`.

Signed-off-by: Daekyoung Jung <[email protected]>
  • Loading branch information
Daekyoung Jung committed Feb 10, 2025
1 parent defb7fc commit 2afc1fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Applications/ReinforcementLearning/DeepQ/jni/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,13 @@ int main(int argc, char **argv) {
std::cerr << "Error during forwarding target network" << std::endl;
return -1;
}
const float *nqa = NQ->getData();
const float *nqa = nullptr;
try {
nqa = NQ->getData();
} catch (std::bad_function_call &e) {
std::cerr << "Error during get data" << std::endl;
return -1;
}

/**
* @brief Update Q values & udpate mainNetwork
Expand Down

0 comments on commit 2afc1fb

Please sign in to comment.