Title: Fatal error: Uncaught Error: Call to a member function setAttribute() on null
Last modified: November 24, 2020

---

# Fatal error: Uncaught Error: Call to a member function setAttribute() on null

 *  Resolved [complex economy](https://wordpress.org/support/users/complex-economy/)
 * (@complex-economy)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-a-member-function-setattribute-on-null/)
 * Fatal error: Uncaught Error: Call to a member function setAttribute() on null
   in /wp-content/plugins/web-stories/includes/AMP/Traits/Sanitization_Utils.php:
   48 Stack trace: #0 /wp-content/plugins/web-stories/includes/AMP/Integration/AMP_Story_Sanitizer.
   php(52): Google\Web_Stories\AMP\Integration\AMP_Story_Sanitizer->transform_html_start_tag(
   Object(DOMDocument)) #1 /wp-content/plugins/accelerated-mobile-pages/includes/
   vendor/amp/includes/class-amp-content.php(135): Google\Web_Stories\AMP\Integration\
   AMP_Story_Sanitizer->sanitize() #2 /wp-content/plugins/accelerated-mobile-pages/
   includes/vendor/amp/includes/class-amp-content.php(100): AMPforWP\AMPVendor\AMP_Content_Sanitizer::
   sanitize(‘<p><html amp=””…’, Array, Array) #3 /wp-content/plugins/accelerated-
   mobile-pages/includes/vendor/amp/includes/class-amp-content. in wp-content/plugins/
   web-stories/includes/AMP/Traits/Sanitization_Utils.php on line 48
 * blog_charset UTF-8
 * AMP Plugin: Accelerated Mobile Pages
 * Also tested it with the official AMP plugin, but it also didn’t work.

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

 *  [Luckyna San](https://wordpress.org/support/users/luckynasan/)
 * (@luckynasan)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-a-member-function-setattribute-on-null/#post-13708388)
 * [@complex-economy](https://wordpress.org/support/users/complex-economy/) Thank
   you for opening your topic. This issue will be addressed in the next release.
   To confirm, using this [official AMP plugin](https://wordpress.org/plugins/amp/)
   did not work for you?
 *  [Luckyna San](https://wordpress.org/support/users/luckynasan/)
 * (@luckynasan)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-a-member-function-setattribute-on-null/#post-13736888)
 * [@complex-economy](https://wordpress.org/support/users/complex-economy/) Hi there,
   just a friendly follow-up. Can you confirm if using the [official AMP plugin](https://wordpress.org/plugins/amp/)
   was successful as a workaround?
 *  Thread Starter [complex economy](https://wordpress.org/support/users/complex-economy/)
 * (@complex-economy)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-a-member-function-setattribute-on-null/#post-13737495)
 * Tested it with this one, but it didn’t work, because it didn’t support web stories
   as content types:
 * Inhaltstypen
 * Aktivierte Inhaltstypen für AMP:
 * Beiträge
    Seiten Medien
 * [https://search.google.com/test/amp?hl=de&id=yesTu2SjFscTmhEq2P_KRQ](https://search.google.com/test/amp?hl=de&id=yesTu2SjFscTmhEq2P_KRQ)
 *  Plugin Author [Pascal Birchler](https://wordpress.org/support/users/swissspidy/)
 * (@swissspidy)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-a-member-function-setattribute-on-null/#post-13737743)
 * [@complex-economy](https://wordpress.org/support/users/complex-economy/) That
   is actually OK! The official AMP plugin will automatically detect Web Stories&
   support them by default.
 * Note that [https://www.finanzweblog.de/web-stories/firmenkonto-vergleichen-gunstiges-geschaftskonto-finden](https://www.finanzweblog.de/web-stories/firmenkonto-vergleichen-gunstiges-geschaftskonto-finden)
   is not a valid web story because it does not have a cover image set in the Document
   panel. You need to set a cover imagge.
 * The fact that the story is being displayed correctly though indicates that the
   fatal error went away?
 *  Thread Starter [complex economy](https://wordpress.org/support/users/complex-economy/)
 * (@complex-economy)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-a-member-function-setattribute-on-null/#post-13777586)
 * Thank you for your help, now it works!
 * The main problem was the missing cover image.
 * Now it works via testing tool with both AMP plugins.
 * The error is still there but it only comes, if you add /amp to your webstories,
   but as you write: “The official AMP plugin will automatically detect Web Stories&
   support them by default.” It seems this also goes for the other plugin. 🙂

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

The topic ‘Fatal error: Uncaught Error: Call to a member function setAttribute()
on null’ is closed to new replies.

 * ![](https://ps.w.org/web-stories/assets/icon.svg?rev=2386543)
 * [Web Stories](https://wordpress.org/plugins/web-stories/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/web-stories/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/web-stories/)
 * [Active Topics](https://wordpress.org/support/plugin/web-stories/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/web-stories/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/web-stories/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [complex economy](https://wordpress.org/support/users/complex-economy/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-a-member-function-setattribute-on-null/#post-13777586)
 * Status: resolved