SOLVED: Nextcloud Logs "Trying to access array offset on value of type null" Repeatedly

Hi @buzz, yes, you’re right, that’s what happens if I don’t test everthing :sweat_smile:

Anyway, the reason is that my addition only checks if $args[2][1] is set for the remainder of that if statement, so the rest of that ill-written function can still throw null pointers around. So another dirty hack without knowing any side effects would be to bail out at the top when either $args[2] or $args[2][1] isn’t set:

if (!isset($args[2]) || !isset($args[2][1])) {
     return static::$nullString;
}

Again, it seems to work for me, but use at your own peril. I really can’t be bothered to look into PHP testing, sorry.