Can I use my method?

Can I do it like my style? Exactly if  decryptFunc is null, we just
need two lines.Am I wrong or anything I missed? btw, edit code in browser , so I can't keep the code format is correct.