Only open browser on successful publish

This checks the returned error code from `writeas` and skips the browser
opening if the status != 0.
This commit is contained in:
Matt Baer 2018-04-19 15:43:28 -04:00
parent caeebc37f3
commit 30b2514b49

View File

@ -207,10 +207,12 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow {
out stdout, out stderr, out status);
// Open it in the browser
var browser = AppInfo.get_default_for_uri_scheme("https");
var urls = new List<string>();
urls.append(stdout.strip());
browser.launch_uris(urls, null);
if (status == 0) {
var browser = AppInfo.get_default_for_uri_scheme("https");
var urls = new List<string>();
urls.append(stdout.strip());
browser.launch_uris(urls, null);
}
return stderr.strip();
} catch (Error err) {