From 0911bab41f33c97b27c376b7d3c89bd99bbfa3ca Mon Sep 17 00:00:00 2001
From: SeBsZ <sebs89@gmail.com>
Date: Wed, 30 Aug 2017 09:52:07 +0200
Subject: [PATCH] Fixes #41743 by checking if the specified widget has been
 registered first before trying to access an undefined index

---
 src/wp-includes/widgets.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php
index fbbdcf5..11ed07d 100644
--- a/src/wp-includes/widgets.php
+++ b/src/wp-includes/widgets.php
@@ -1036,6 +1036,10 @@ function wp_convert_widget_settings($base_name, $option_name, $settings) {
 function the_widget( $widget, $instance = array(), $args = array() ) {
 	global $wp_widget_factory;
 
+	if ( ! ( isset($wp_widget_factory->widgets[$widget]) ) ) {
+		return;
+	}
+
 	$widget_obj = $wp_widget_factory->widgets[$widget];
 	if ( ! ( $widget_obj instanceof WP_Widget ) ) {
 		return;
-- 
2.10.0.windows.1

