Ad
  • Custom User Avatar

    The reason is that the length is sometimes 0. You could evaluate whether the length is equal to 0 before you start your computation.