Skip to content

Commit

Permalink
Added check for tag_index availability. steemit#647
Browse files Browse the repository at this point in the history
  • Loading branch information
AKorpusenko committed May 17, 2018
1 parent eb6bc29 commit 4a76d1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/tags/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,10 @@ namespace golos { namespace plugins { namespace tags {
// Needed for correct work of golos::api::discussion_helper::set_pending_payout and etc api methods
void fill_promoted( discussion & d, golos::chain::database& db) {
if (!db.has_index<tags::tag_index>()) {
return;
}
const auto& cidx = db.get_index<tags::tag_index>().indices().get<tags::by_comment>();
auto itr = cidx.lower_bound(d.id);
if (itr != cidx.end() && itr->comment == d.id) {
Expand Down

0 comments on commit 4a76d1f

Please sign in to comment.