urvanov-ru / crayon-syntax-highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
https://wordpress.org/plugins/urvanov-syntax-highlighter/
GNU General Public License v3.0
60 stars 11 forks source link

Attempt to read property "ID" on null in #42

Open dougherty-dev opened 2 years ago

dougherty-dev commented 2 years ago

class-urvanov-syntax-highlighter-plugin.php on line 666:

$post_id = strval($post->ID);

There is no post-ID for 404s.

urvanov-ru commented 2 years ago

I didn't fix it with this update. But I will try to fix it with the next one.

urvanov-ru commented 2 years ago

Actually, it is really strange, that global $post variable is null. I don't know why it should be...