mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(editor): Fix and report settings
being null
in workflow payloads (no-changelog) (#9227)
This commit is contained in:
parent
99f384e2cf
commit
11a3572144
|
@ -82,6 +82,7 @@ import { useUsersStore } from '@/stores/users.store';
|
|||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { getCredentialOnlyNodeTypeName } from '@/utils/credentialOnlyNodes';
|
||||
import { i18n } from '@/plugins/i18n';
|
||||
import { ErrorReporterProxy as EventReporter } from 'n8n-workflow';
|
||||
|
||||
const defaults: Omit<IWorkflowDb, 'id'> & { settings: NonNullable<IWorkflowDb['settings']> } = {
|
||||
name: '',
|
||||
|
@ -1312,6 +1313,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
|||
forceSave = false,
|
||||
): Promise<IWorkflowDb> {
|
||||
const rootStore = useRootStore();
|
||||
|
||||
if (data.settings === null) {
|
||||
EventReporter.info('Detected workflow payload with settings as null');
|
||||
data.settings = undefined;
|
||||
}
|
||||
|
||||
return await makeRestApiRequest(
|
||||
rootStore.getRestApiContext,
|
||||
'PATCH',
|
||||
|
@ -1322,6 +1329,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
|||
|
||||
async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> {
|
||||
const rootStore = useRootStore();
|
||||
|
||||
if (startRunData.workflowData.settings === null) {
|
||||
EventReporter.info('Detected workflow payload with settings as null');
|
||||
startRunData.workflowData.settings = undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
return await makeRestApiRequest(
|
||||
rootStore.getRestApiContext,
|
||||
|
|
Loading…
Reference in a new issue