Skip to content

Commit f0847fc

Browse files
authored
fix: prevent crash when repository url is empty
1 parent f095112 commit f0847fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/remote.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<'repo> Remote<'repo> {
147147

148148
/// Get the remote's URL as a byte array.
149149
pub fn url_bytes(&self) -> &[u8] {
150-
unsafe { crate::opt_bytes(self, raw::git_remote_url(&*self.raw)).unwrap() }
150+
unsafe { crate::opt_bytes(self, raw::git_remote_url(&*self.raw)).unwrap_or(&[]) }
151151
}
152152

153153
/// Get the remote's pushurl.

0 commit comments

Comments
 (0)