mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-24 08:12:24 +02:00
All: Handle missing resource blob when setting resource size
This commit is contained in:
parent
e4a08c29d7
commit
07e88b2eeb
@ -113,6 +113,10 @@ class ResourceService extends BaseService {
|
||||
|
||||
static async autoSetFileSize(resourceId, filePath) {
|
||||
const itDoes = await shim.fsDriver().waitTillExists(filePath);
|
||||
if (!itDoes) {
|
||||
this.logger().warn('Trying to set file size on non-existent resource:', resourceId, filePath);
|
||||
return;
|
||||
}
|
||||
const fileStat = await shim.fsDriver().stat(filePath);
|
||||
await Resource.setFileSizeOnly(resourceId, fileStat.size);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user