Run max_length option only if slug is a string

Just a little variable type validation before running substr() to adjust the slug to the max_length option. 
This allows the slug to be saved as NULL in the database, for example, when returning a NULL value from a custom method's closure.