because String(null) returns "null", you can use "x as String" (for null, it will return null)