mirror of
https://github.com/n8n-io/n8n.git
synced 2024-09-11 21:17:50 +03: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 { useSettingsStore } from '@/stores/settings.store';
|
||||||
import { getCredentialOnlyNodeTypeName } from '@/utils/credentialOnlyNodes';
|
import { getCredentialOnlyNodeTypeName } from '@/utils/credentialOnlyNodes';
|
||||||
import { i18n } from '@/plugins/i18n';
|
import { i18n } from '@/plugins/i18n';
|
||||||
|
import { ErrorReporterProxy as EventReporter } from 'n8n-workflow';
|
||||||
|
|
||||||
const defaults: Omit<IWorkflowDb, 'id'> & { settings: NonNullable<IWorkflowDb['settings']> } = {
|
const defaults: Omit<IWorkflowDb, 'id'> & { settings: NonNullable<IWorkflowDb['settings']> } = {
|
||||||
name: '',
|
name: '',
|
||||||
@ -1312,6 +1313,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
|||||||
forceSave = false,
|
forceSave = false,
|
||||||
): Promise<IWorkflowDb> {
|
): Promise<IWorkflowDb> {
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
|
|
||||||
|
if (data.settings === null) {
|
||||||
|
EventReporter.info('Detected workflow payload with settings as null');
|
||||||
|
data.settings = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return await makeRestApiRequest(
|
return await makeRestApiRequest(
|
||||||
rootStore.getRestApiContext,
|
rootStore.getRestApiContext,
|
||||||
'PATCH',
|
'PATCH',
|
||||||
@ -1322,6 +1329,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
|||||||
|
|
||||||
async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> {
|
async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> {
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
|
|
||||||
|
if (startRunData.workflowData.settings === null) {
|
||||||
|
EventReporter.info('Detected workflow payload with settings as null');
|
||||||
|
startRunData.workflowData.settings = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await makeRestApiRequest(
|
return await makeRestApiRequest(
|
||||||
rootStore.getRestApiContext,
|
rootStore.getRestApiContext,
|
||||||
|
Loading…
Reference in New Issue
Block a user