ensure disamb is WisskiSparqlResultRow object or NULL
When both disambiguation queries returned no results, the $disambresult variable remained a WisskiSparqlResult object instead of being converted to a WisskiSparqlResultRow or set to NULL. Added else { $disambresult = NULL; } after the second query check ensuring that $disambresult is WisskiSparqlResultRow or NULL.