Avoid compile warning in test for slime

Checking if the function exists before trying to use it avoids a warning at startup when not defined.