Title: Warning: Trying to access array offset on null
Last modified: March 5, 2025

---

# Warning: Trying to access array offset on null

 *  Resolved [Giannis Kipouros](https://wordpress.org/support/users/giannis4/)
 * (@giannis4)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/warning-trying-to-access-array-offset-on-null/)
 * Hi,
 * I am using the plugin version 2.4.2 and it throws a warning:
 * “Warning: Trying to access array offset on null in …\fields\acf-font-awesome-
   v5.php on line 280”
 * After some inspection it looks like it is the function maybe_enqueue_font_awesome(
   field) that does not validate that $field[‘type’] and $field[‘enqueue_fa’] are
   set.
 * Can you please check this?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Matt Keys](https://wordpress.org/support/users/mattkeys/)
 * (@mattkeys)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/warning-trying-to-access-array-offset-on-null/#post-18344367)
 * Are you sure about that plugin version? That would be quite a bit out of date.
   4.1.2 is the latest version.
 * If you are actually on that old of a version please update this plugin, and go
   re-save your ACF field groups with this icon field in them. Making sure to double
   check any settings along the way. In fact that is probably a good first step 
   for you here either way. It feels like for some reason on your site those settings
   are stored properly in your DB.
 *  Thread Starter [Giannis Kipouros](https://wordpress.org/support/users/giannis4/)
 * (@giannis4)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/warning-trying-to-access-array-offset-on-null/#post-18344431)
 * Hi,
 * You are right, it is version 4.1.2.
 * It wont be easy to save all ACF fields since there are too many of them on separate
   installations.
 * Can you add a check on line 279 of acf-font-awesome-v5.php and make it:
 *     ```wp-block-code
       if ( isset( $field['type'] &&        isset( $field['enqueue_fa'] ) &&	'font-awesome' == $field['type'] &&	$field['enqueue_fa'] ) {	   add_action( 'wp_footer', array( $this, 'frontend_enqueue_scripts' ) );	}
       ```
   
 *  Plugin Author [Matt Keys](https://wordpress.org/support/users/mattkeys/)
 * (@mattkeys)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/warning-trying-to-access-array-offset-on-null/#post-18344527)
 * Yes this section can be more ‘defensively’ coded to prevent this error, I’ll 
   look to do that in the next update of this plugin. I’m still not sure why this
   is coming up on your site though, that code has been in place for some time without
   any other reports of issues. Presumably there is an edge case unique to your 
   installation but hard to say.
 *  Thread Starter [Giannis Kipouros](https://wordpress.org/support/users/giannis4/)
 * (@giannis4)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/warning-trying-to-access-array-offset-on-null/#post-18344562)
 * Hi Matt,
   Great! Thank you.
 * I am trying to refactor an old site with many customizations. An old setting 
   stored in the DB could be the culprit. Checking before using the array values
   can cover all cases and avoid unwanted warnings.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Warning: Trying to access array offset on null’ is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields-font-awesome/assets/icon-256x256.
   jpg?rev=3435775)
 * [Advanced Custom Fields: Font Awesome Field](https://wordpress.org/plugins/advanced-custom-fields-font-awesome/)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields-font-awesome/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields-font-awesome/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields-font-awesome/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields-font-awesome/reviews/)

## Tags

 * [warnings](https://wordpress.org/support/topic-tag/warnings/)

 * 4 replies
 * 2 participants
 * Last reply from: [Giannis Kipouros](https://wordpress.org/support/users/giannis4/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/warning-trying-to-access-array-offset-on-null/#post-18344562)
 * Status: resolved