mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-23 23:42:29 +00:00
Dont try to set the commit if it's undefined
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
1690171304
commit
bb549a445b
@ -622,7 +622,7 @@ module.exports = class ApplicationManager extends EventEmitter
|
||||
pairSteps = @_nextStepsForVolume(pair, currentApp, removePairs.concat(updatePairs))
|
||||
steps = steps.concat(pairSteps)
|
||||
|
||||
if _.isEmpty(steps) and currentApp.commit != targetApp.commit
|
||||
if _.isEmpty(steps) and targetApp.commit? and currentApp.commit != targetApp.commit
|
||||
steps.push({
|
||||
action: 'updateCommit'
|
||||
target: targetApp.commit
|
||||
|
@ -159,7 +159,7 @@ export class Config extends (EventEmitter as new () => ConfigEventEmitter) {
|
||||
|
||||
// if we have anything other than a string, it must be converted to
|
||||
// a string before being stored in the db
|
||||
const strValue = Config.valueToString(value);
|
||||
const strValue = Config.valueToString(value, key);
|
||||
|
||||
if (oldValues[key] !== value) {
|
||||
return this.db.upsertModel(
|
||||
@ -336,7 +336,7 @@ export class Config extends (EventEmitter as new () => ConfigEventEmitter) {
|
||||
});
|
||||
}
|
||||
|
||||
private static valueToString(value: unknown) {
|
||||
private static valueToString(value: unknown, name: string) {
|
||||
switch (typeof value) {
|
||||
case 'object':
|
||||
return JSON.stringify(value);
|
||||
@ -346,7 +346,7 @@ export class Config extends (EventEmitter as new () => ConfigEventEmitter) {
|
||||
return value.toString();
|
||||
default:
|
||||
throw new InternalInconsistencyError(
|
||||
`Could not convert configuration value to string for storage, value: ${value}, type: ${typeof value}`,
|
||||
`Could not convert configuration value to string for storage, name: ${name}, value: ${value}, type: ${typeof value}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user