fix logic error 'array access results in a null pointer dereference' refs #187
small refactoring for fix logic error 'array access results in a null pointer dereference'
Merge pull request #193 from siberianisaev/issue_187

fix logic error 'array access results in a null pointer dereference'