inserIntoPlate coaster为空时报错
This commit is contained in:
parent
8f1a6c125d
commit
8b8b8b8214
@ -6,6 +6,7 @@ import (
|
|||||||
// "fmt"
|
// "fmt"
|
||||||
"github.com/phyer/core"
|
"github.com/phyer/core"
|
||||||
"os"
|
"os"
|
||||||
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
//"strings"
|
//"strings"
|
||||||
// "sync"
|
// "sync"
|
||||||
@ -83,6 +84,11 @@ func (mmx *MyMaX) InsertIntoPlate(cr *core.Core) (*core.Sample, error) {
|
|||||||
// err := errors.New("coaster创建失败 maX instId: " + mx.InstID + "; period: " + mx.Period)
|
// err := errors.New("coaster创建失败 maX instId: " + mx.InstID + "; period: " + mx.Period)
|
||||||
// return nil, err
|
// return nil, err
|
||||||
// }
|
// }
|
||||||
sm, err := pl.CoasterMap["period"+mx.Period].RPushSample(cr, mx, "ma"+strconv.Itoa(mx.Count))
|
coaster := pl.CoasterMap["period"+mx.Period]
|
||||||
|
if reflect.ValueOf(coaster).IsNil() {
|
||||||
|
logrus.Warnf("coaster is nil for instID: %s, period: %s", mx.InstID, mx.Period)
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
sm, err := coaster.RPushSample(cr, mx, "ma"+strconv.Itoa(mx.Count))
|
||||||
return sm, err
|
return sm, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user