You can just use `isset`. It checks for null already. Also, the 4.1 branch would be better for this if it is a bugfix.

`if ( ! isset($line)) return $key;`