In /plugins/user/phpbb3.php, replace line 92:

if(!isset($userid)) {

with:

if (( ! isset( $userid )) || ( strlen( $userid ) == 0 )) {              // it's set, but has no value

It’s the only (isset($userid)) in the file, so should be easy to find.