C# Entity Framework with linq returns null reference
===

I have a problem with entity framework in C#.
I have 2 entities, User and UserRole. They are bond by relationships User *->1 UserRole

Whenever I use this query in a function:

    User user = context.User.Where(i => i.id == id).FirstOrDefault();
    return user.UserRole.accessLevel;

The query returns user, but UserRole is null. The User table has roleId which is related to id of UserRole, and the value of roleId when debugging is correct, although UserRole entity is null. This is strange as it never happened before...

I already made sure that my relationships in model and database are correct. I have correct rows added to database.