Commit 1ea69afe authored by Piotr Gawron's avatar Piotr Gawron
Browse files

the user might be null

parent 486b27d9
...@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment