Add extra check before dereferencing iterator.
Add extra check before dereferencing iterator.

nickerso/libcellml,cellml/libcellml,cellml/libcellml,MichaelClerx/libcellml,cellml/libcellml,nickerso/libcellml,MichaelClerx/libcellml,nickerso/libcellml,hsorby/libcellml,hsorby/libcellml,cellml/libcellml,hsorby/libcellml,hsorby/libcellml,MichaelClerx/libcellml,nickerso/libcellml