Check uris before applying them
This commit is contained in:
7
entry.go
7
entry.go
@@ -62,8 +62,13 @@ func NewEntry(title string) (*Entry, error) {
|
||||
return nil, fmt.Errorf("error creating new entry: %v", err)
|
||||
}
|
||||
|
||||
id, err := NewID(NewURN())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating new entry: %v", err)
|
||||
}
|
||||
|
||||
return &Entry{
|
||||
ID: NewID(NewURN()),
|
||||
ID: id,
|
||||
Title: text,
|
||||
Updated: NewDate(time.Now()),
|
||||
}, nil
|
||||
|
Reference in New Issue
Block a user