1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-25 16:59:17 +01:00

show string errors

This commit is contained in:
Kyle Spearrin 2018-05-02 16:00:46 -04:00
parent 66bdf442d6
commit c29b53cdd6

View File

@ -12,7 +12,9 @@ export class ValidationService {
const defaultErrorMessage = this.i18nService.t('unexpectedError');
const errors: string[] = [];
if (data == null || typeof data !== 'object') {
if (data != null && typeof data === 'string') {
errors.push(data);
} else if (data == null || typeof data !== 'object') {
errors.push(defaultErrorMessage);
} else if (data.validationErrors == null) {
errors.push(data.message ? data.message : defaultErrorMessage);