'sonarqube warning for Change this condition so that it does not always evaluate to 'false'

I have following code and getting warning by sonaqube at line

Unable to understand what's the problem or what correction i should do

 public static Exception ExceptionProcessingForHttpTypeRequest(Exception ex)
        {
            if (ex.InnerException is TimeoutException)
            {
                ex = ex.InnerException;
            }
            else if (ex is TaskCanceledException)
            {
            
               //Change this condition so that it does not always evaluate to 'false'.
                if ((ex as TaskCanceledException).CancellationToken == null || !(ex as TaskCanceledException).CancellationToken.IsCancellationRequested)

                {
                    ex = new TimeoutException("Task Canceled due to Timeout");
                }
                else if (ex.InnerException != null)
                {
                    ex = new Exception("TaskCanceled Inner exception," + ex.InnerException.Message, ex.InnerException);
                }
            }
            return ex;
        }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source