Repository: spyder-ide/spyder

Issue:
Error in "Check for updates"
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

Click on Help
Click on Check for Updates
Issue reporter opens.

### Traceback
```python-traceback
Traceback (most recent call last):
  File "/home/huw/miniforge3/envs/py310/lib/python3.10/site-packages/spyder/plugins/application/container.py", line 366, in check_updates
    self.application_update_status.set_status_checking()
AttributeError: 'NoneType' object has no attribute 'set_status_checking'
```

## Versions

* Spyder version: 5.4.0  (conda)
* Python version: 3.10.6 64-bit
* Qt version: 5.15.6
* PyQt5 version: 5.15.7
* Operating System: Linux 5.15.0-53-generic

### Dependencies

```
# Mandatory:
atomicwrites >=1.2.0          :  1.4.1 (OK)
chardet >=2.0.0               :  5.0.0 (OK)
cloudpickle >=0.5.0           :  2.2.0 (OK)
cookiecutter >=1.6.0          :  2.1.1 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.31.1;<8.0.0       :  7.33.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.17.0 (OK)
keyring >=17.0.0              :  23.11.0 (OK)
nbconvert >=4.0               :  7.2.4 (OK)
numpydoc >=0.6.0              :  1.5.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.4 (OK)
pygments >=2.0                :  2.13.0 (OK)
pylint >=2.5.0;<3.0           :  2.15.5 (OK)
pylint_venv >=2.1.1           :  2.3.0 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.6.0;<1.7.0          :  1.6.0 (OK)
pylsp_black >=1.2.0           :  1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0     :  3.0.3 (OK)
qstylizer >=0.2.2             :  0.2.2 (OK)
qtawesome >=1.2.1             :  1.2.1 (OK)
qtconsole >=5.4.0;<5.5.0      :  5.4.0 (OK)
qtpy >=2.1.0                  :  2.3.0 (OK)
rtree >=0.9.7                 :  1.0.1 (OK)
setuptools >=49.6.0           :  65.5.1 (OK)
sphinx >=0.6.6                :  5.3.0 (OK)
spyder_kernels >=2.4.0;<2.5.0 :  2.4.0 (OK)
textdistance >=4.2.0          :  4.5.0 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.9 (OK)
xdg >=0.26                    :  0.28 (OK)
zmq >=22.1.0                  :  24.0.1 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=3.0.0            :  3.6.2 (OK)
numpy >=1.7                   :  1.23.4 (OK)
pandas >=1.1.1                :  1.5.1 (OK)
scipy >=0.17.0                :  1.9.3 (OK)
sympy >=0.7.3                 :  None (NOK)
```



Discussion:
Hi @bertzruph thank you for the feedback! I was able to reproduce this. We will fix it in out next release :+1:

Resolving patch:
diff --git a/spyder/plugins/application/container.py b/spyder/plugins/application/container.py
--- a/spyder/plugins/application/container.py
+++ b/spyder/plugins/application/container.py
@@ -297,10 +297,10 @@ def _check_updates_ready(self):
             box.exec_()
             check_updates = box.is_checked()
         else:
-
             if update_available:
-                self.application_update_status.set_status_pending(
-                    latest_release=latest_release)
+                if self.application_update_status:
+                    self.application_update_status.set_status_pending(
+                        latest_release=latest_release)
 
                 header = _("<b>Spyder {} is available!</b> "
                            "<i>(you have {})</i><br><br>").format(
@@ -332,13 +332,13 @@ def _check_updates_ready(self):
                 box.setText(msg)
                 box.set_check_visible(True)
                 box.exec_()
-
-                if box.result() == QMessageBox.Yes:
-                    self.application_update_status.start_installation(
-                        latest_release=latest_release)
-                elif(box.result() == QMessageBox.No):
-                    self.application_update_status.set_status_pending(
-                        latest_release=latest_release)
+                if self.application_update_status:
+                    if box.result() == QMessageBox.Yes:
+                        self.application_update_status.start_installation(
+                            latest_release=latest_release)
+                    elif box.result() == QMessageBox.No:
+                        self.application_update_status.set_status_pending(
+                            latest_release=latest_release)
                 check_updates = box.is_checked()
             elif feedback:
                 msg = _("Spyder is up to date.")
@@ -346,9 +346,11 @@ def _check_updates_ready(self):
                 box.set_check_visible(False)
                 box.exec_()
                 check_updates = box.is_checked()
-                self.application_update_status.set_no_status()
+                if self.application_update_status:
+                    self.application_update_status.set_no_status()
             else:
-                self.application_update_status.set_no_status()
+                if self.application_update_status:
+                    self.application_update_status.set_no_status()
         # Update checkbox based on user interaction
         self.set_conf(option, check_updates)
 
@@ -363,7 +365,8 @@ def check_updates(self, startup=False):
         """Check for spyder updates on github releases using a QThread."""
         # Disable check_updates_action while the thread is working
         self.check_updates_action.setDisabled(True)
-        self.application_update_status.set_status_checking()
+        if self.application_update_status:
+            self.application_update_status.set_status_checking()
 
         if self.thread_updates is not None:
             self.thread_updates.quit()


Test patch: