]> Nutra Git (v1) - nutratech/gui.git/commitdiff
lint/fix cache not loaded potential condition
authorShane Jaroch <chown_tee@proton.me>
Wed, 21 Jan 2026 19:20:13 +0000 (14:20 -0500)
committerShane Jaroch <chown_tee@proton.me>
Wed, 21 Jan 2026 19:20:13 +0000 (14:20 -0500)
src/db/foodrepository.cpp

index c8787239a306a9b799f40a59d50fd94c25b4aec4..2a713462aef35ca77354997994245ed0d557b75d 100644 (file)
@@ -166,6 +166,7 @@ std::vector<FoodItem> FoodRepository::searchFoods(const QString& query) {
 }
 
 std::vector<Nutrient> FoodRepository::getFoodNutrients(int foodId) {
+    ensureCacheLoaded();
     std::vector<Nutrient> results;
     QSqlDatabase db = DatabaseManager::instance().database();