Undefined index problem fixed, refs #1170.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Fixed tickets |
| Refs tickets  |
| License       | MIT