Skip to content
Snippets Groups Projects
Commit 1ea69afe authored by Piotr Gawron's avatar Piotr Gawron
Browse files

the user might be null

parent 486b27d9
No related branches found
No related tags found
1 merge request!859Resolve "deprecacy information for data overlay"
...@@ -28,8 +28,9 @@ public class FileService implements IFileService { ...@@ -28,8 +28,9 @@ public class FileService implements IFileService {
@Override @Override
public User getOwnerByFileId(int id) { public User getOwnerByFileId(int id) {
UploadedFileEntry entry = uploadedFileEntryDao.getById(id); UploadedFileEntry entry = uploadedFileEntryDao.getById(id);
if (entry != null) { if (entry != null && entry.getOwner() != null) {
uploadedFileEntryDao.getById(id).getOwner().getLogin(); //it's lazy initialized
entry.getOwner().getLogin();
return uploadedFileEntryDao.getById(id).getOwner(); return uploadedFileEntryDao.getById(id).getOwner();
} else { } else {
return null; return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment