fix(): fix npe on empty strings (trim())

solves #435
solves again #281, #281, #298