Skip to content

Commit

Permalink
Check if paths exists
Browse files Browse the repository at this point in the history
  • Loading branch information
chiteroman committed Jan 11, 2025
1 parent 51b38ea commit 07eb652
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/src/main/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,15 @@ static void companion(int fd) {

std::vector<uint8_t> dex, json;

dex = readFile(DEX_PATH);
if (std::filesystem::exists(DEX_PATH)) {
dex = readFile(DEX_PATH);
}

json = readFile(PIF_JSON);
if (json.empty()) json = readFile(PIF_JSON_DEFAULT);
if (std::filesystem::exists(PIF_JSON)) {
json = readFile(PIF_JSON);
} else if (std::filesystem::exists(PIF_JSON_DEFAULT)) {
json = readFile(PIF_JSON_DEFAULT);
}

int dexSize = static_cast<int>(dex.size());
int jsonSize = static_cast<int>(json.size());
Expand Down

0 comments on commit 07eb652

Please sign in to comment.