Skip to content

invariant_booleans works incorrectly in switch #58571

Closed
@EvGeniyLell

Description

@EvGeniyLell

invariant_booleans works incorrectly in switch
in second examination buffer i have the analizator problem

Conditions should not unconditionally evaluate to true or to false. verify: buffer != null.

      switch (callbackType) {
        case dto.GeneratePdfCallbacks.progress:
          if (buffer != null) {
            onProgress(
              DtoPdfDocumentValue.proggresFomGeneratePdfProgressBuffer(buffer),
            );
            return;
          }
          break;
        case dto.GeneratePdfCallbacks.complete:
          if (buffer != null) { /// <- at this place
            onComplete(
              DtoPdfDocument.fromGeneratePdfCompleteBuffer(buffer),
            );
            return;
          }
          break;
        default:
          super.callback(index, buffer);
          break;
      }

I think it is wrong behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions