Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error related to weakref if creating a viewer failed #1501

Merged
merged 1 commit into from
Jan 19, 2018

Conversation

astrofrog
Copy link
Member

This fixes the following exception:

Traceback (most recent call last):
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/app/qt/mdi_area.py", line 61, in dropEvent
    new_layer(layer)
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/app/qt/mdi_area.py", line 51, in new_layer
    self._application.choose_new_data_viewer(layer)
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/app/qt/application.py", line 849, in choose_new_data_viewer
    return self.do(cmd)
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/core/application_base.py", line 218, in do
    return self._cmds.do(command)
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/core/command.py", line 127, in do
    result = cmd.do(self._session)
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/core/command.py", line 218, in do
    self.created = weakref.ref(v)
TypeError: cannot create weak reference to 'NoneType' object

if e.g. trying to initialize a 3D volume viewer with a 1D dataset, which causes a GUI error and makes add_data return False.

@astrofrog astrofrog added this to the v0.12.4 milestone Jan 18, 2018
@astrofrog astrofrog merged commit 0c2af11 into glue-viz:master Jan 19, 2018
@astrofrog astrofrog modified the milestones: v0.12.4, v0.12.5 Mar 7, 2018
astrofrog added a commit that referenced this pull request Mar 7, 2018
Fix error related to weakref if creating a viewer failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant