Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: impl/prod/context.go

Issue 1916463004: impl/memory: Disallow empty namespace. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Remove memcache. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: impl/prod/context.go
diff --git a/impl/prod/context.go b/impl/prod/context.go
index 983b06b01018a0c753aeb68b80428ed9cf768c1f..96bea791b1cab296c2c09fefd9dc94716cc8122e 100644
--- a/impl/prod/context.go
+++ b/impl/prod/context.go
@@ -57,9 +57,13 @@ func AEContextNoTxn(c context.Context) context.Context {
if aeCtx == nil {
return nil
}
- aeCtx, err := appengine.Namespace(aeCtx, info.Get(c).GetNamespace())
- if err != nil {
- panic(err)
+
+ if ns, has := info.Get(c).GetNamespace(); has {
+ var err error
+ aeCtx, err = appengine.Namespace(aeCtx, ns)
+ if err != nil {
+ panic(err)
+ }
}
if deadline, ok := c.Deadline(); ok {
aeCtx, _ = context.WithDeadline(aeCtx, deadline)
« impl/memory/datastore.go ('K') | « impl/memory/taskqueue.go ('k') | impl/prod/info.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698