Making slider responses compulsory online

My experiment is dependent upon participants ratings of stimuli as measured using a slider.
I have code to make a response compulsory that works when running builder but does not work when I try to use the code online. Is anyone able to assist please?

The code I have is:
if F_Liking_Builder.getRating() is not None:
if NextStim_ULiking.keys == ‘space’:
continueRoutine = False

When you use None in Python the auto translator incorrectly translates it to null. You then have to set the code component to Both and change null to undefined.