Skip to content

Commit

Permalink
fix Eugeny#8534 : skip yaml unacceptable kind of object to dump
Browse files Browse the repository at this point in the history
  • Loading branch information
Clem-Fern committed Jul 7, 2023
1 parent 6709217 commit 82a2620
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tabby-core/src/services/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ export class ConfigService {
// Scrub undefined values
let cleanStore = JSON.parse(JSON.stringify(this._store))
cleanStore = await this.maybeEncryptConfig(cleanStore)
await this.platform.saveConfig(yaml.dump(cleanStore))
await this.platform.saveConfig(yaml.dump(cleanStore, {skipInvalid: true}))
this.emitChange()
}

/**
* Reads config YAML as string
*/
readRaw (): string {
return yaml.dump(this._store)
return yaml.dump(this._store, {skipInvalid: true})
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tabby-settings/src/services/configSync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class ConfigSyncService {
data[part] = remoteData[part]
}
}
const content = yaml.dump(data)
const content = yaml.dump(data, {skipInvalid: true})
const result = await this.updateConfig(this.config.store.configSync.configID, {
content,
last_used_with_version: this.platform.getAppVersion(),
Expand Down Expand Up @@ -154,7 +154,7 @@ export class ConfigSyncService {
}

private async writeConfigDataFromSync (data: any) {
await this.platform.saveConfig(yaml.dump(data))
await this.platform.saveConfig(yaml.dump(data, {skipInvalid: true}))
await this.config.load()
await this.config.save()
}
Expand Down

0 comments on commit 82a2620

Please sign in to comment.