This could be just shortened to:
```
return (result && result[1]) || null;
```