Don't assume that "resource" property is in metadata.

Reported by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2010-04-28 22:23:29 +00:00
parent beef45ff88
commit 1228041bd5

View File

@ -117,7 +117,7 @@ metadata_read(struct hast_resource *res, bool openrw)
}
str = nv_get_string(nv, "resource");
if (strcmp(str, res->hr_name) != 0) {
if (str != NULL && strcmp(str, res->hr_name) != 0) {
pjdlog_error("Provider %s is not part of resource %s.",
res->hr_localpath, res->hr_name);
nv_free(nv);