Skip to content

Commit

Permalink
Fix text initialization upon WebMetadata fetch failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasschwab committed Jan 7, 2025
1 parent 9889a52 commit db02a63
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/tir/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ func init() {
}

func fromUrl(url string) {
initial, err := web.WebMetadata(url)
if err != nil {
if initial, err := web.WebMetadata(url); err != nil {
log.Printf("coultn't read '%s'; skipping: %v", url, err)
from(&text.Text{URL: url})
} else {
from(initial)
}
from(initial)
}

func from(initial *text.Text) {
Expand Down

0 comments on commit db02a63

Please sign in to comment.