Undefined index: und
I like to use EntityAPI module for working with fields. You don't need to worry about some key exists or not. here is an example:

$entityWrapper = entity_metadata_wrapper('ENTITY_TYPE (eg. node, user..)', ENTITY_KEY_OR_ENTITY);

$protectionFieldValue = $entityWrapper-&gt;field_protection-&gt;value();

if (null != $protectionFieldValue /* put your condition */) {
  form_set_error('from', t("Protected !!!"));
  return;
}


or here is a way without an EntityAPI:

if (isset($act-&gt;field_protection['und']) &amp;&amp; ($is_protected  = (int)$act-&gt;field_protection['und']['0']['value'])) {
    if ($is_protected == 1) {
      form_set_error('from', t("Protected !!!"));
      return;
    }
}