X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2FrmrCgo%2FrmrCgoUtils.go;h=c9d11471de030b5b2ffb05568156fe4059dd6db9;hb=0249b5fc410b6c6814906b185dfdf25b27621148;hp=f26d168eb00dd97e0d8ca4debbd9e77d17a53772;hpb=b3805a9d29e2c7f6f14e3fedfa1ba504f734eea9;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/rmrCgo/rmrCgoUtils.go b/E2Manager/rmrCgo/rmrCgoUtils.go index f26d168..c9d1147 100644 --- a/E2Manager/rmrCgo/rmrCgoUtils.go +++ b/E2Manager/rmrCgo/rmrCgoUtils.go @@ -63,6 +63,9 @@ func (ctx *Context) getAllocatedCRmrMBuf(logger *logger.Logger, mBuf *MBuf, maxM var meidBuf[RMR_MAX_MEID_LEN]byte cMBuf = C.rmr_alloc_msg(ctx.RmrCtx, C.int(maxMsgSize)) + if cMBuf == nil { + return nil + } cMBuf.mtype = C.int(mBuf.MType) cMBuf.len = C.int(mBuf.Len) @@ -105,9 +108,9 @@ func (ctx *Context) getAllocatedCRmrMBuf(logger *logger.Logger, mBuf *MBuf, maxM //TODO: change to assert or return error func (ctx *Context) checkContextInitialized() { if ctx.RmrCtx == nil { - if ctx.Logger != nil { + /*if ctx.Logger != nil { ctx.Logger.DPanicf("#rmrCgoUtils.checkContextInitialized - The RMR router has not been initialized") - } + }*/ panic("#rmrCgoUtils.checkContextInitialized - The RMR router has not been initialized. To initialize router please call Init() method") } }