Skip to content

Crash on DrawableTransformation if the custom transform returns null #5651

@spocky

Description

@spocky

When implementing a custom DrawableTransformation, if for any reason, the custom transform() method returns null, then a check here fails with a null object exception because it tests if transformed.equals(original).

On the other hand, on BitmapTransformation, the check is the opposite here : it tests if original.equals(transformed) which lets the code handle null correctly.

As a result, if the transformation can't be done, this forces to throw an Exception that won't be caught. Inverting the test as done on the BitmapTransformation seems like an easy fix (and even though the custom transform() should probably avoid returning null, this would at least provide better consistency).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions