Add warnings for failed storage operations.
[bluesky.git] / bluesky / file.c
index 35ed1dc..311afc3 100644 (file)
@@ -225,6 +225,13 @@ static void block_fetch_completion(BlueSkyStoreAsync *async, gpointer data)
     bluesky_string_unref(block->data);
     block->data = async->data;
     bluesky_string_ref(block->data);
+
+    if (block->data == NULL) {
+        g_warning("Failed to fetch data block from store!\n");
+        block->data = bluesky_string_new(g_malloc0(BLUESKY_BLOCK_SIZE),
+                                         BLUESKY_BLOCK_SIZE);
+    }
+
     block->type = BLUESKY_BLOCK_CACHED;
 }