+Arathy: Fixing js error with a null check