summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-upgrade-file.c3
-rw-r--r--src/core/wee-upgrade.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/core/wee-upgrade-file.c b/src/core/wee-upgrade-file.c
index 2048fbfbe..08088f223 100644
--- a/src/core/wee-upgrade-file.c
+++ b/src/core/wee-upgrade-file.c
@@ -780,5 +780,6 @@ upgrade_file_read (struct t_upgrade_file *upgrade_file,
void
upgrade_file_close (struct t_upgrade_file *upgrade_file)
{
- fclose (upgrade_file->file);
+ if (upgrade_file && upgrade_file->file)
+ fclose (upgrade_file->file);
}
diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c
index 01fc52ab3..b9d9c0e72 100644
--- a/src/core/wee-upgrade.c
+++ b/src/core/wee-upgrade.c
@@ -775,6 +775,8 @@ upgrade_weechat_load ()
upgrade_layout = gui_layout_alloc (GUI_LAYOUT_UPGRADE);
upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME, 0);
+ if (!upgrade_file)
+ return 0;
rc = upgrade_file_read (upgrade_file, &upgrade_weechat_read_cb, NULL);
upgrade_file_close (upgrade_file);