I can not set resolution

If I click on Free Aspect to set the resolution, nothing happens and I get this error:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorWindow.Close () (at :0)
UnityEditor.PopupWindow.CloseWindow () (at :0)
UnityEditor.AssemblyReloadEvents.OnBeforeAssemblyReload () (at :0)

I have this equal error and I don’t know where is the fail:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.PopupWindow.Show (UnityEngine.Rect activatorRect, UnityEditor.PopupWindowContent windowContent, UnityEditor.PopupLocation locationPriorityOrder, UnityEditor.ShowMode showMode) (at <507f517ae7864f439b730eed1dbf6793>:0)
UnityEditor.PopupWindow.Show (UnityEngine.Rect activatorRect, UnityEditor.PopupWindowContent windowContent, UnityEditor.PopupLocation locationPriorityOrder) (at <507f517ae7864f439b730eed1dbf6793>:0)
UnityEditor.PopupWindow.Show (UnityEngine.Rect activatorRect, UnityEditor.PopupWindowContent windowContent) (at <507f517ae7864f439b730eed1dbf6793>:0)

This happened to me I reset my layout and it works fine just go to “Window>Layouts>Revert Factory Settings.”
Hope this helps