For our sake, use , [html] or [code] tags (as appropriate) to delineate code and make it readable.
The error and source code comments tells you exactly what's wrong: $robots isn't an array, which can happen if no "robots.txt" file is found. If a value isn't what you expect, debug. Either use...