Catch if the extend value is not a dict per #4524
Verify the format of the context, fix #4524