Add Dashlet does not Work - 500 Console Error

SuiteCRM Version 7.10.8
PHP Version 7.0.33
Ubuntu 16.04

Trying to add new dashlet from CHARTS tab causes 500 Internal server error, console has the following Line.
https://mycrm.com/index.php?action=DynamicAction&DynamicAction=displayDashlet&session_commit=1&module=Home&to_pdf=1&id=f36aeaf0-1498-0cee-896f-5dbb2dfbb077

Permissions on cache, custom and modules folder looks right. Nothing in CRM, ERROR logs. Any suggestions ?

Figured it out. It seems to be coming from SuiteCRM file at include/Dashlets/DashletGenericChart.php

The line that causes the Error is

$temp = (object) array('db' => &DBManagerFactory::getInstance(), 'report_def_str' => '');

So replaced that with the newer version resolved the issue.

$db = DBManagerFactory::getInstance();
$temp = (object) array('db' => &$db, 'report_def_str' => '');