mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(fix)db: prevent invalid refs from crashing db update (#1816)
Previously when ROAM_REFS is non-empty, but the refs are invalid, this will cause an empty SQL expression and crash the db caching. This fixes that scenario.
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
- [#1798](https://github.com/org-roam/org-roam/pull/1798) org-roam-node-at-point: do not skip invisible headings
|
||||
- [#1807](https://github.com/org-roam/org-roam/pull/1807) capture: always trigger `:if-new` template for existing nodes
|
||||
- [#1813](https://github.com/org-roam/org-roam/pull/1813) db: prevent empty ROAM_ALIASES from crashing db updates
|
||||
- [#1816](https://github.com/org-roam/org-roam/pull/1816) db: prevent invalid ROAM_REFS from crashing db updates
|
||||
|
||||
## 2.1.0
|
||||
### Added
|
||||
|
@ -418,9 +418,10 @@ If UPDATE-P is non-nil, first remove the file in the database."
|
||||
(push (vector node-id (match-string 2 ref) (match-string 1 ref)) rows))
|
||||
(lwarn '(org-roam) :warning
|
||||
"%s:%s\tInvalid ref %s, skipping..." (buffer-file-name) (point) ref))))
|
||||
(org-roam-db-query [:insert :into refs
|
||||
:values $v1]
|
||||
rows))))
|
||||
(when rows
|
||||
(org-roam-db-query [:insert :into refs
|
||||
:values $v1]
|
||||
rows)))))
|
||||
|
||||
(defun org-roam-db-insert-link (link)
|
||||
"Insert link data for LINK at current point into the Org-roam cache."
|
||||
|
Reference in New Issue
Block a user