Check length of resulting string before removing the last '.'

The resulting string could be empty when `expression.GetExpressionChain` returns an empty list.
This happens e.g. when the method is called with an expression like `x => x`