fix: fix default_adapter.Get()

This commit is contained in:
weloe
2023-08-10 21:15:32 +08:00
parent 097d1b9445
commit a9aa15db0c
2 changed files with 3 additions and 5 deletions

View File

@@ -92,12 +92,9 @@ func (d *DefaultAdapter) Get(key string, t ...reflect.Type) interface{} {
d.getExpireAndDelete(key)
value, _ := d.dataMap.Load(key)
if d.serializer == nil {
if d.serializer == nil || t == nil || len(t) == 0 {
return value
}
if t == nil && len(t) == 0 {
return nil
}
bytes, err := util.InterfaceToBytes(value)
if err != nil {
log.Printf("Adapter.Get() failed: %v", err)