summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.go8
-rw-r--r--unix.go4
2 files changed, 12 insertions, 0 deletions
diff --git a/common.go b/common.go
index 8895542..8b88913 100644
--- a/common.go
+++ b/common.go
@@ -70,6 +70,14 @@ func (rs *RepoStatus) IsProtobuf() (bool, []string, error) {
// returns the filesystem path to the repo
func (rs *RepoStatus) Path() string {
+ if rs == nil {
+ log.Warn("rs == nil")
+ return ""
+ }
+ if rs.realPath == nil {
+ log.Warn("rs.realPath == nil")
+ return ""
+ }
return rs.realPath.String()
}
diff --git a/unix.go b/unix.go
index 6d90676..d4d48de 100644
--- a/unix.go
+++ b/unix.go
@@ -221,6 +221,10 @@ func IsDirectory(path string) bool {
}
func (rs *RepoStatus) Exists(filename string) bool {
+ if rs == nil {
+ log.Warn("rs == nil for Exists()")
+ panic(-1)
+ }
testf := filepath.Join(rs.Path(), filename)
if Exists(testf) {
return true