mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 22:07:56 +01:00
Don't crash if a file is deleted before OCR is completed
This commit is contained in:
parent
b8061a6a1e
commit
c283607063
@ -48,6 +48,11 @@ public class FileCreatedAsyncListener {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
FileDao fileDao = new FileDao();
|
FileDao fileDao = new FileDao();
|
||||||
|
if (fileDao.getById(file.getId()) == null) {
|
||||||
|
// The file has been deleted since the OCR-ization started, ignore the result
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
file.setContent(content);
|
file.setContent(content);
|
||||||
fileDao.update(file);
|
fileDao.update(file);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user