Skip to content

Commit

Permalink
Ignore other harmless error (fixes #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamVenner committed Mar 20, 2022
1 parent dc5cb6f commit aa32823
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blackhole"
version = "4.0.1"
version = "4.0.2"
authors = ["William Venner <william@venner.io>"]
edition = "2018"
repository = "https://github.com/WilliamVenner/blackhole"
Expand Down
8 changes: 5 additions & 3 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ impl Windows for Blackhole {
.output() {
Err(err) => { Show::error(&format!("Error executing PowerShell script: {}", err)) },
Ok(output) => {
if std::str::from_utf8(&output.stderr).map(|str| str.contains("called on MessageLoop that's already been Quit!")).unwrap_or(false) {
// A silly fix for a silly error (the script still worked)
return;
if let Ok(stderr) = std::str::from_utf8(&output.stderr) {
if stderr.contains("called on MessageLoop that's already been Quit!") || stderr.contains("LoadBitmapFromPngResource") {
// A silly fix for a silly error (the script still worked)
return;
}
}

if output.stderr.len() > 0 {
Expand Down

0 comments on commit aa32823

Please sign in to comment.