Help ** Illegal String Offset 'type' In /app/addons/discussion/func.php

Hello

I am getting the following error

Illegal string offset 'type' in /home/server1/public_html/app/addons/discussion/func.php on line 380

All I did is upgraded my server to 15.04 Ubuntu x64 which runs

PHP 5.6.11-1ubuntu3.2 (cli)
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
I am running - CS-Cart 4.2.4
Its a dedicated server
My Line 380 of /home/server1/public_html/app/addons/discussion/func.php is as follows
if (empty($discussion) || ($discussion['type'] != 'R' && $discussion['type'] != 'B')) {

I will appreciate any help.

Try to replace:

if (empty($discussion) || ($discussion['type'] != 'R' && $discussion['type'] != 'B')) {

with

if (empty($discussion) || (!empty($discussion['type']) && $discussion['type'] != 'R' && $discussion['type'] != 'B')) {

Did not work for me. Still getting same error.

Try to check the presence with isset(variable),

if (isset($discussion['type']) .....){

Please try

if (empty($discussion) || (!empty($discussion) && isset($discussion['type']) && $discussion['type'] != 'R' && $discussion['type'] != 'B')) {