Skip to content

Commit

Permalink
Fix #32
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Oct 27, 2023
1 parent 2b1cbeb commit 424eb88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ void budget::assets_module::handle(const std::vector<std::string>& args){
} else if (subcommand == "portfolio") {
budget::show_asset_portfolio(w);
} else if (subcommand == "add") {
auto asset_classes = all_asset_classes();

if (asset_classes.empty()) {
throw budget_exception("You must first create asset classes before creating assets");
}

asset asset;
asset.guid = generate_guid();

Expand All @@ -103,8 +109,6 @@ void budget::assets_module::handle(const std::vector<std::string>& args){
asset.share_based = false;
asset.ticker = "";

auto asset_classes = all_asset_classes();

do {
for (auto& clas : asset_classes) {
budget::money alloc = get_asset_class_allocation(asset, clas);
Expand Down

0 comments on commit 424eb88

Please sign in to comment.