Explicitly check whether `Model::getRelated()` returns a model
Fix the "removeSession" callbacks (see #5353)
Merge branch 'hotfix/3.0.6' into develop