Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
msm-code committed Oct 1, 2024
1 parent 27f1e5b commit 3541d91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libursa/Query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ const std::vector<Query> &Query::as_queries() const {
type != QueryType::MIN_OF) {
throw std::runtime_error("This query doesn\'t contain subqueries.");
}
return queries;
}

std::vector<Query> &Query::as_queries() {
if (type != QueryType::AND && type != QueryType::OR &&
type != QueryType::MIN_OF) {
throw std::runtime_error("This query doesn\'t contain subqueries.");
}
return queries;
}

Expand Down
1 change: 1 addition & 0 deletions libursa/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Query {
Query &operator=(Query &&) = default;

const std::vector<Query> &as_queries() const;
std::vector<Query> &as_queries();
const QString &as_value() const;
uint32_t as_count() const;
std::string as_string_repr() const;
Expand Down

0 comments on commit 3541d91

Please sign in to comment.