Fix seg fault in GetOnuOmciState()
Change-Id: I72f9810fd0a3666dd41f435568d0ea761e33ad12
diff --git a/omci_state.go b/omci_state.go
index 4aedd28..8e4af35 100644
--- a/omci_state.go
+++ b/omci_state.go
@@ -39,11 +39,12 @@
}
func GetOnuOmciState(onuId uint32, intfId uint32) istate {
- /*
- key := OnuKey{intfId, onuId}
- return (OnuOmciStateMap[key].state)
- */
- return INCOMPLETE
+ key := OnuKey{intfId, onuId}
+ if onu, ok := OnuOmciStateMap[key]; ok {
+ return onu.state
+ } else {
+ return INCOMPLETE
+ }
}
func GetGemPortId(onuId uint32, intfId uint32) uint16 {