Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-299

DamFilePreviewComponent will fail on assets with short filenames

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1, 1.2
    • 1.0.2
    • None
    • None
    • Magnolia CE 5.0.4

      Steps to reproduce:

      • create an image file with a 2 letter filename, e.g. use the attached "p1.png"
      • upload this file to the DAM (everything's fine so far)
      • select this file in some dialog (e.g. component dialog)
        => the file will not be displayed in the preview
        => the log will show a NPE

      When you debug this, you'll see that the problem in fact is not a NPE, but "java.lang.IllegalArgumentException: Prefix string too short" on DamFilePreviewComponent line 163.

      Workaround: Once you make sure, that the filename of the temp file is at least 4 letters long, things work fine. The attached patch does this, but it might not be the prettiest way...

        Acceptance criteria

              Unassigned Unassigned
              will Will Scheidegger
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD