mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-04 20:54:21 +03:00
graph-store: safely peek update-log
Safely returns a null when either the update-log does not exists, or it is empty Fixes #3976
This commit is contained in:
parent
6bb62d802b
commit
88adb0033a
@ -748,12 +748,14 @@
|
||||
[%x %peek-update-log @ @ ~]
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ update-log=(unit update-log:store) (~(get by update-logs) [ship term])
|
||||
?~ update-log [~ ~]
|
||||
=/ result=(unit [time update:store])
|
||||
(peek:orm-log:store u.update-log)
|
||||
?~ result [~ ~]
|
||||
``noun+!>([~ -.u.result])
|
||||
=/ m-update-log=(unit update-log:store) (~(get by update-logs) [ship term])
|
||||
:- ~ :- ~ :- %noun
|
||||
!> ^- (unit time)
|
||||
%+ biff m-update-log
|
||||
|= =update-log:store
|
||||
=/ result=(unit [=time =update:store])
|
||||
(peek:orm-log:store update-log)
|
||||
(bind result |=([=time update:store] time))
|
||||
==
|
||||
::
|
||||
++ get-node
|
||||
|
Loading…
Reference in New Issue
Block a user