Skip to content
Snippets Groups Projects
Commit 2b02655a authored by syuilo's avatar syuilo
Browse files

Fix bug

parent bc06c664
No related branches found
No related tags found
No related merge requests found
......@@ -100,7 +100,7 @@ export function validatePassword(password: string): boolean {
}
export function isValidName(name: string): boolean {
return typeof name == 'string' && name.length < 30 && name.trim() != '';
return name === null || (typeof name == 'string' && name.length < 30 && name.trim() != '');
}
export function isValidDescription(description: string): boolean {
......
......@@ -24,7 +24,7 @@ export default async (value, verifier?: string) => {
object.type !== 'Person' ||
typeof object.preferredUsername !== 'string' ||
!validateUsername(object.preferredUsername) ||
(object.name != '' && !isValidName(object.name)) ||
!isValidName(object.name == '' ? null : object.name) ||
!isValidDescription(object.summary)
) {
throw new Error('invalid person');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment