How to put a if else in a function

so if i not enter both value there will having a crash appear


so i want to make it limited at the input part to stop this happening