Adds a null check for the eclResDef pointer before accessing its members. This prevents a potential crash if eclResDef is null. Additionally, the unnecessary assertions are removed.