diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts index 33031a3940..e18ab7bea9 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts @@ -244,7 +244,7 @@ export class UploadButtonComponent { * @returns {string} */ private getErrorMessage(response: any): string { - if (response.body.error.statusCode === ERROR_FOLDER_ALREADY_EXIST ) { + if (response.body && response.body.error.statusCode === ERROR_FOLDER_ALREADY_EXIST ) { let errorMessage: any; errorMessage = this.translate.get('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST'); return errorMessage.value; diff --git a/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts b/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts index 01df09f10d..5f3f656342 100644 --- a/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts +++ b/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts @@ -115,7 +115,7 @@ export class UploadService { * @returns {AlfrescoApi.ApiClient} */ private getAlfrescoClient() { - return AlfrescoApi.getClientWithTicket(this.getBaseUrl(), this.getAlfrescoTicket()); + return AlfrescoApi.getClientWithTicket(this.settings.getApiBaseUrl(), this.getAlfrescoTicket()); } /**