fix: add nil guard for StaticFS and set default PostsPerPage in FirstRun

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Leon Mika 2026-03-22 14:41:50 +11:00
parent f68bac809f
commit 40da63368a
2 changed files with 9 additions and 5 deletions

View file

@ -572,6 +572,9 @@ func (b *Builder) writeUploads(ctx buildContext, uploads []models.Upload) error
}
func (b *Builder) writeStaticAssets(ctx buildContext) error {
if b.opts.StaticFS == nil {
return nil
}
return fs.WalkDir(b.opts.StaticFS, ".", func(path string, d os.DirEntry, err error) error {
if err != nil {
return err

View file

@ -81,6 +81,7 @@ func (s *Service) FirstRun(ctx context.Context, req FirstRunRequest) (newUser mo
GUID: models.NewNanoID(),
OwnerID: newUser.ID,
Timezone: "UTC",
PostsPerPage: 10,
Created: time.Now(),
}
if err := s.db.SaveSite(ctx, &newSite); err != nil {