Skip to content

Commit

Permalink
handlers: check for file existence before setting contents
Browse files Browse the repository at this point in the history
  • Loading branch information
jonian committed Mar 22, 2021
1 parent 0bb9bd3 commit 3c7b5cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion unite@hardpixel.eu/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ function getFileContents(path) {
}

function setFileContents(path, contents) {
GLib.file_set_contents(path, contents)
if (fileExists(path)) {
GLib.file_set_contents(path, contents)
}
}

function resetGtkStyles(filepath) {
Expand Down

0 comments on commit 3c7b5cc

Please # to comment.