mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
not found should return null
This commit is contained in:
parent
f148d7fcf2
commit
f90554e87e
@ -20,7 +20,7 @@ console.log("Wave Starting");
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
console.log("DOMContentLoaded");
|
||||
// ensures client/window are loaded into the cache before rendering
|
||||
// ensures client/window/workspace are loaded into the cache before rendering
|
||||
await WOS.loadAndPinWaveObject<Client>(WOS.makeORef("client", clientId));
|
||||
const waveWindow = await WOS.loadAndPinWaveObject<WaveWindow>(WOS.makeORef("window", windowId));
|
||||
await WOS.loadAndPinWaveObject<Workspace>(WOS.makeORef("workspace", waveWindow.workspaceid));
|
||||
|
@ -156,6 +156,9 @@ func SetMeta(waveObj WaveObj, meta map[string]any) {
|
||||
}
|
||||
|
||||
func ToJsonMap(w WaveObj) (map[string]any, error) {
|
||||
if w == nil {
|
||||
return nil, nil
|
||||
}
|
||||
m := make(map[string]any)
|
||||
dconfig := &mapstructure.DecoderConfig{
|
||||
Result: &m,
|
||||
|
@ -103,7 +103,10 @@ func DBGetORef(ctx context.Context, oref waveobj.ORef) (waveobj.WaveObj, error)
|
||||
table := tableNameFromOType(oref.OType)
|
||||
query := fmt.Sprintf("SELECT oid, version, data FROM %s WHERE oid = ?", table)
|
||||
var row idDataType
|
||||
tx.Get(&row, query, oref.OID)
|
||||
found := tx.Get(&row, query, oref.OID)
|
||||
if !found {
|
||||
return nil, nil
|
||||
}
|
||||
rtn, err := waveobj.FromJson(row.Data)
|
||||
if err != nil {
|
||||
return rtn, err
|
||||
|
Loading…
Reference in New Issue
Block a user