Really? When I do something like that, a body field with no data at all throws an exception. I knew it - Drupal hates me!

 
Nancy
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.


From: Lucas D Hedding
Nancy, I tend to do the following (using body as an example) in pseudo standard data import script.

$body = $wrapper->body->value();
if (empty($body)) {
  // Do something, for example set a value to avoid Undefined variable notices
  $wrapper->body->set(array('value' => ''));
}
// Now I can deal with the data as if it were populated.
if ($wrapper->body->value->raw() != $this->Body) {
  $wrapper->body->set(array('value' => $this->Body, 'format' => 'full_html'));
}