diff --git a/profiles/gatt/gas.c b/profiles/gatt/gas.c
index 33a680f..39e9421 100644
--- a/profiles/gatt/gas.c
+++ b/profiles/gatt/gas.c
gsize length = 0;
filename = btd_device_get_storage_path(device, "gatt");
+ if (!filename) {
+ warn("Unable to get gatt storage path for device");
+ return;
+ }
key_file = g_key_file_new();
g_key_file_load_from_file(key_file, filename, 0, NULL);
int err = 0;
filename = btd_device_get_storage_path(device, "gatt");
+ if (!filename) {
+ warn("Unable to get gatt storage path for device");
+ return -ENOENT;
+ }
snprintf(group, sizeof(group), "%hu", uuid);