We were cleaning up some old cruft related to work history that could be used to populate the Job Title shown below your username:
This whole section was kinda redundant / unnecessary, and caused some amount of confusion:
As part of this, we've done a bit of refactoring for the logic that uses this data - specifically, a method that tries to format a title from some combination of the Role, Description and Organization fields that might have been populated from that form. This method originally lived in the Razor view that implements that part of the user page, and deftly avoided problems by using this handy extension method named IsEmpty().
That method was moved to a normal CS file, at which point that extension method was no longer available by default. That should have broken the build (and would never have been committed), but it turns out we have a different extension method floating around our codebase...
public static bool IsEmpty<T>(this IEnumerable<T> collection) => !collection.Any();
That's very different logic from what StringExtensions.IsEmpty() provides - critically, it doesn't cleanly handle a NULL parameter. But, since String implements IEnumerable, the compiler happily substituted the new extension method for the old and the build completed without complaint. All was well... Unless anyone ever happened to have a NULL value for one of the work history fields.
And they were null on those profiles.
The logic now checks for null explicitly, doesn't call any methods named IsEmpty()
, and should therefore proceed cleanly as we continue stripping out this old logic. Hat-tip to Dean Ward for jumping in to fix it!