mirror of
https://git.victorphan.net/basketballcantho/Teedy_custom.git
synced 2026-08-05 14:03:10 +07:00
Don't crash if a file is deleted before OCR is completed
This commit is contained in:
+5
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user