I had the same problem, so I changed the word "theme_location" to "name" and it works perfectly.
Example:
$defaults = array(
'[INSTEAD OF PUTTING "theme_location" PUT "name"]' => 'THE NAME OF YOUR "theme_location"',
'menu_class' => 'YOUR CLASS', **[It will change the <UL> class]**
);
wp_nav_menu( $defaults );
So for your code:
wp_nav_menu( array(
'name' => 'top-menu',
'menu_class'=> 'YOUR CLASS'
) );
wp_nav_menu( $defaults );
enter image description here
You can also put it into a container like a <DIV> or a <NAV> etc.
Example:
$defaults = array(
'name' => 'top-menu',
'menu_id' => 'YOUR ID',
'container' => 'nav',
'container_class' => 'YOUR CONTAINER CLASS (<nav> in this case)',
'menu_class' => 'YOUR CLASS FOR <UL>',
);
wp_nav_menu( $defaults );
enter image description here
wp_nav_menu
. – Assist