Skip to content

Commit 804a884

Browse files
committed
fix: make trimTrailingDotGit null safe
1 parent 06ad5b6 commit 804a884

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/db/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const toClass = function (obj: any, proto: any) {
66

77
export const trimTrailingDotGit = (str: string): string => {
88
const target = '.git';
9-
if (str.endsWith(target)) {
9+
if (str && str.endsWith(target)) {
1010
// extract string from 0 to the end minus the length of target
1111
return str.slice(0, -target.length);
1212
}

0 commit comments

Comments
 (0)