The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Fix compile warning

Changes made to birdfont-autotrace/AutoTrace.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- birdfont-autotrace/AutoTrace.vala +++ 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;