The problem is in this expression:
var ReportsString = Telerik.Sitefinity.Model.DataExtensions.GetValue(CurrentUserProfile,
In case the field is null, you are trying to assign a null value to var (an implicitly-typed local variable). Since the field from the user profile are accessed at runtime, you get a runtime error, i.e. you do not get an error when you compile the solution, which makes your build successful. Moreover, if the field is not null, it you will not get an error, because you will assign some value to the implicitly-typed local variable (var).
This is how you need to do the null check, so it will work in both cases (null or not-null):
// The rest of the code here - ex: the check for string.Empty
I hope this will help you solve your problem. Do not hesitate to write us in case other issues appear.
All the best,
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking
system and vote to affect the priority of the items