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 {
@Override
public User getOwnerByFileId(int id) {
UploadedFileEntry entry = uploadedFileEntryDao.getById(id);
if (entry != null) {
uploadedFileEntryDao.getById(id).getOwner().getLogin();
if (entry != null && entry.getOwner() != null) {
//it's lazy initialized
entry.getOwner().getLogin();
return uploadedFileEntryDao.getById(id).getOwner();
} else {
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