The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix compile warning

These changes was commited to the Birdfont repository Sun, 27 Sep 2015 17:42:58 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sun, 27 Sep 2015 17:42:58 +0000]

Updated Files

birdfont-autotrace/AutoTrace.vala
--- a/birdfont-autotrace/AutoTrace.vala +++ b/birdfont-autotrace/AutoTrace.vala @@ -149,12 +149,17 @@ file = File.new_for_path (file_name); - if (file.query_exists ()) { - file.delete (); + try { + if (file.query_exists ()) { + file.delete (); + } + + data_stream = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); + data_stream.put_string (svg); + } catch (GLib.Error e) { + warning(e.message); + return 1; } - - data_stream = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); - data_stream.put_string (svg); } return 0;