Skip to content

Commit

Permalink
Check appcast item correctness
Browse files Browse the repository at this point in the history
Check if an item is valid, i.e. has either a usable enclosure or a link
to open in the browser.
  • Loading branch information
vslavik committed Nov 19, 2024
1 parent 26867f0 commit c36170d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/appcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void XMLCALL OnEndElement(void *data, const char *name)
}
}

if (is_compatible_with_windows_version(item))
if (item.IsValid() && is_compatible_with_windows_version(item))
{
ctxt.all_items.push_back(item);

Expand Down
2 changes: 1 addition & 1 deletion src/appcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct Appcast
static Appcast Load(const std::string& xml);

/// Returns true if the struct constains valid data.
bool IsValid() const { return !Version.empty(); }
bool IsValid() const { return !Version.empty() && (HasDownload() || !WebBrowserURL.empty()); }

/// If true, then download and install the update ourselves.
/// If false, launch a web browser to WebBrowserURL.
Expand Down

0 comments on commit c36170d

Please sign in to comment.