Shouldn't this be `!filename.AsString().IsEmpty()`?