From 2914a89e110954c61caee413bb728e69c7d243aa Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Fri, 27 Apr 2018 00:24:14 +0200 Subject: [PATCH] swarm/api: move debug line to avoid panic --- swarm/api/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swarm/api/api.go b/swarm/api/api.go index e7df353b8d..479446279c 100644 --- a/swarm/api/api.go +++ b/swarm/api/api.go @@ -321,9 +321,9 @@ func (self *Api) Get(key storage.Key, path string) (reader *storage.LazyChunkRea log.Debug("trie getting entry", "key", key, "path", path) entry, _ := trie.getEntry(path) - log.Debug("trie got entry", "key", key, "path", path, "entry.Hash", entry.Hash) if entry != nil { + log.Debug("trie got entry", "key", key, "path", path, "entry.Hash", entry.Hash) // we want to be able to serve Mutable Resource Updates transparently using the bzz:// scheme // // we use a special manifest hack for this purpose, which is pathless and where the resource root key @@ -337,6 +337,7 @@ func (self *Api) Get(key storage.Key, path string) (reader *storage.LazyChunkRea return nil, entry.ContentType, http.StatusOK, &ErrResourceReturn{entry.Hash} } key = common.Hex2Bytes(entry.Hash) + log.Debug("trie key", "key", key) status = entry.Status if status == http.StatusMultipleChoices { apiGetHttp300.Inc(1)