Skip to content

Commit df1da90

Browse files
committed
fix: datalist set null error
1 parent 277595c commit df1da90

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

api/lua.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ func (l *Lua) Delete() error {
4141

4242
// LoadLuas load all lua scripts
4343
func LoadLuas(luas *[]Lua) error {
44-
var byts [][]byte
45-
if err := GlobalStorage.ReadAll(luaStorageCollection, &byts); err != nil {
44+
var bytes [][]byte
45+
if err := GlobalStorage.ReadAll(luaStorageCollection, &bytes); err != nil {
4646
return err
4747
}
4848

49-
if err := RecordsToStruct(byts, luas); err != nil {
49+
if err := RecordsToStruct(bytes, luas); err != nil {
5050
return err
5151
}
5252

web/src/components/lua/Luas.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const Luas = (props: ILuaProps) => {
2525
setError(undefined);
2626
setLoading(true);
2727
loadLuas(connection.id)
28-
.then((v: Lua[]) => setLuas(v))
28+
.then((v: Lua[]) => setLuas(v || []))
2929
.catch((err: Error) => { setError(err); })
3030
.finally(() => { setLoading(false) });
3131
}, [connection.id])

0 commit comments

Comments
 (0)