forked from friendica/friendica-addons
a bit more defensiveness about add_retriever_item
This commit is contained in:
parent
13f3b44522
commit
fafe6a2ea4
|
@ -448,7 +448,9 @@ function retriever_on_item_insert(array $retriever, array &$item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$resource = add_retriever_resource($url, $item['uid'], $item['contact-id']);
|
$resource = add_retriever_resource($url, $item['uid'], $item['contact-id']);
|
||||||
$retriever_item_id = add_retriever_item($item, $resource);
|
if (is_array($resource)) {
|
||||||
|
$retriever_item_id = add_retriever_item($item, $resource);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -744,12 +746,15 @@ function retrieve_images(array &$item) {
|
||||||
}
|
}
|
||||||
if (strpos($url, (string)(DI::baseUrl())) === FALSE) {
|
if (strpos($url, (string)(DI::baseUrl())) === FALSE) {
|
||||||
$resource = add_retriever_resource($url, $item['uid'], $item['contact-id'], true);
|
$resource = add_retriever_resource($url, $item['uid'], $item['contact-id'], true);
|
||||||
|
if (!is_array($resource)) {
|
||||||
|
Logger::error('retrieve_images: could not add resource', ['url' => $url, 'uid' => $item['uid'], 'contact-id' => $item['contact-id']]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!$resource['completed']) {
|
if (!$resource['completed']) {
|
||||||
add_retriever_item($item, $resource);
|
add_retriever_item($item, $resource);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
retriever_transform_images($item, $resource);
|
||||||
retriever_transform_images($item, $resource);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue