In my debug.log I have a warningPHP Warning: array_key_exists()

In my debug.log I have a warning:

[16-May-2017 10:50:37 America/Toronto] PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /home/mary/public_html/mary-content/plugins/widget-options/includes/widgets/display.php on line 155

The actual code for line 155 is if( $visibility_opts == 'hide' && array_key_exists( $type , $visibility['types']) ){
$hidden = true; //hide if exists on hidden pages

Can you tell me please how to fix it