belongsTo relationship should return null when the id is null.

__Problem__
id typeof "object" is true when id is null which leads to an exception.

__Solution__
Check if the id is null before the typeof check.