After many hours of searching and researching and posting question here, I have managed to resolve this myself. The problem wasn't where I thought it was. The correct code which helped me do this is as follows:
<?php if( osc_user_name() != null ) { ?>
<a href="<?php echo osc_user_public_profile_url( osc_item_user_id() ); ?>" ><?php echo osc_user_name(); ?></a>
<?php } else { ?>
<?php printf(__('%s', 'aiclassy'), osc_user_name()); ?>
<?php } ?>
Instead of checking if osc_item_user_id wasn't null, like this
<?php if( osc_item_user_id() != null ) { ?>
I checked if osc_user_name() wasn't null and then put it in link like this
<?php if( osc_user_name() != null ) { ?>
<a href="<?php echo osc_user_public_profile_url( osc_item_user_id() ); ?>" ><?php echo osc_user_name(); ?></a>
<?php } else { ?>
<?php printf(__('%s', 'aiclassy'), osc_user_name()); ?>
And it worked like a charm. I really hope this helps someone if in similar trouble. Cheers!