Skip to content

[6.x] Fix TypeError when asset last_modified meta is null#14530

Merged
jasonvarga merged 3 commits intostatamic:6.xfrom
v-Woody:fix/asset-last-modified-null-check
Apr 23, 2026
Merged

[6.x] Fix TypeError when asset last_modified meta is null#14530
jasonvarga merged 3 commits intostatamic:6.xfrom
v-Woody:fix/asset-last-modified-null-check

Conversation

@v-Woody
Copy link
Copy Markdown
Contributor

@v-Woody v-Woody commented Apr 21, 2026

Summary

  • Fixes a TypeError in Asset::lastModified() when the last_modified meta value is null
  • Falls back to epoch 0 instead of passing null to Carbon::createFromTimestamp()
  • Adds a test covering the null meta scenario

Fixes #14529

@v-Woody v-Woody changed the title Fix TypeError when asset last_modified meta is null [6.x] Fix TypeError when asset last_modified meta is null Apr 21, 2026
@jasonvarga
Copy link
Copy Markdown
Member

Thank you.
I tweaked the test - it would've passed even without your fix.

And regarding your fix - it's a band-aid, but I'm fine with that for now.
e.g. It'll say last modified 55 years ago. At least it doesn't crash.

@jasonvarga jasonvarga merged commit b845e8f into statamic:6.x Apr 23, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError in Asset::lastModified() when last_modified meta is null

2 participants