mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +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
|
||||
public void run() {
|
||||
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);
|
||||
fileDao.update(file);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user