"to 'len' (string expected, got nil)" Dark RP LUA Coding error

I’ve encountered a problem while setting up a function that counts the length of a job title, saying that the ‘len’ function is receiving nothing, when it really is.
Screenshots of this working:

(I added the print function to show that the function is receiving something)

If anyone has anyway of expanding a background rectangle with text like below, that’d also solve my problem I’m trying to overcome.

The job is probably not initialised by the time you’ve started running it. Add an or clause in case the return is nil. Ex. ply:GetDarkRPVar(“job”) or “”

It worked, thanks! But now I’m being faced with another error…
“attempt to concatenate a nil value”
Any ideas?

Just like before, change to (Player:getDarkRPVar(“job”) or “”)

It’s all working now, cheers mate