Ad
  • Default User Avatar

    I completly agree with that comment.

    Adding a null check will solve this at the start of the function. It isn't too clear what to do for error case. I suppose returning 'null' would be ok, but throwing a new ArgumentNullException works too.

  • Custom User Avatar

    This solution will fail if the argument (cc) == null => Calling Length property will throw a "System.NullReferenceException: 'Object reference not set to an instance of an object.'"