diff --git a/src/addon/mod/data/fields/url/providers/handler.ts b/src/addon/mod/data/fields/url/providers/handler.ts index ae8eb55d5..1854df829 100644 --- a/src/addon/mod/data/fields/url/providers/handler.ts +++ b/src/addon/mod/data/fields/url/providers/handler.ts @@ -54,7 +54,7 @@ export class AddonModDataFieldUrlHandler extends AddonModDataFieldTextHandler { { fieldid: field.id, subfield: '0', - value: inputData[fieldName] || '' + value: (inputData[fieldName] && inputData[fieldName].trim()) || '' } ]; }