mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 05:22:51 +00:00
Throw error if project name has leading or trailing whitespace (#15842)
GitOrigin-RevId: 65dc375535dbab66b7446642c6b2d14c978d3c38
This commit is contained in:
parent
c4e8fe67ce
commit
aed5c911f2
1 changed files with 3 additions and 11 deletions
|
@ -138,17 +138,9 @@ async function validateProjectName(name) {
|
|||
)
|
||||
}
|
||||
if (name !== name.trim()) {
|
||||
const message = 'Project name cannot start or end with whitespace'
|
||||
|
||||
const error = new Errors.InvalidNameError({
|
||||
message,
|
||||
info: { name },
|
||||
})
|
||||
|
||||
logger.warn({ error }, message)
|
||||
|
||||
// TODO: throw the error, after checking that it won't cause problems
|
||||
// throw error
|
||||
throw new Errors.InvalidNameError(
|
||||
'Project name cannot start or end with whitespace'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue