statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
104 stars 71 forks source link

Check if a asset extension could be found #234

Closed jonassiewertsen closed 5 months ago

jonassiewertsen commented 5 months ago

It may be, that I had corrupt assets in my import.

To not abort the import script, I added a check, if the extension could be found. In case it returns null, the import aborts.

Integrity constraint violation: 1048 Column 'extension' cannot be null

To improve the check, some kind of notice, that a certain image could not be imported may be nice. Anyways, I thought I'll drop this little change to see, if this is something that should be implemented.

ryanmitchell commented 5 months ago

Looks good. I guess the only other approach would be to just set extension to an empty string? I guess we need to decide if a lack of extension is valid or not... ?