Skip to content

Crash on Linux "AttributeError: 'NoneType' object has no attribute 'value'" #1027

@MadMartian

Description

@MadMartian

MCEdit Unified bug report template. For MCEdit 2.0 bugs see here : https://github.com/mcedit/mcedit2

Description of Issue:

MCEdit fails to start, classic NPE (Null-pointer exception): "AttributeError: 'NoneType' object has no attribute 'value'"

MCEdit Version:

v1.6.0.0

Minecraft Version the world was last opened in:

A 1.7.10 custom modded world

Operating System:

Linux 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

A screenshot or full text of the error from the console:

[ ERROR][ root.py:1013]:MCEdit version Unified v1.6.0.0 %s Minecraft 1.8-1.12.2 | PE 1.6
Traceback (most recent call last):
File "mcedit.py", line 1076, in
main(sys.argv)
File "mcedit.py", line 1010, in main
MCEdit.main()
File "mcedit.py", line 856, in main
["Don't remind me again.", "OK"], default=1, cancel=1)
File "/opt/oss/MCEdit-Unified/albow/dialogs.py", line 178, in ask
return box.present()
File "/opt/oss/MCEdit-Unified/albow/widget.py", line 538, in present
self.root.run_modal(self)
File "/opt/oss/MCEdit-Unified/albow/root.py", line 361, in run_modal
self.size = (event.w, event.h)
File "/opt/oss/MCEdit-Unified/albow/widget.py", line 48, in set
self._resized(old_size)
File "/opt/oss/MCEdit-Unified/albow/widget.py", line 182, in _resized
self.resized(dw, dh)
File "/opt/oss/MCEdit-Unified/albow/widget.py", line 188, in resized
widget.parent_resized(dw, dh)
File "/opt/oss/MCEdit-Unified/albow/widget.py", line 233, in parent_resized
self.rect = Rect((left, top, width, height))
File "/opt/oss/MCEdit-Unified/albow/widget.py", line 163, in set_rect
self._resized(old_size)
File "/opt/oss/MCEdit-Unified/albow/widget.py", line 182, in _resized
self.resized(dw, dh)
File "mcedit.py", line 663, in resized
maximized = win.get_state() == mcplatform.MAXIMIZED
File "/opt/oss/MCEdit-Unified/mcplatform.py", line 997, in get_state
if state.value:
AttributeError: 'NoneType' object has no attribute 'value'

How to reproduce:

Consistently reproducible, MCEdit refuses to start

Read before submitting

If we are not able to reproduce the error, we may ask for you to submit a world so we can test it. Same process for schematics.
If you have included enough information for each section, please delete the above header and all the text below.

Adding the following lines to mcplatform.py on line 995 resolves the issue:

	if state is None:
		return NORMAL

It appears the _NET_WM_STATE property is absent, this code I've manually added is a workaround, and then I was able to load a world, copy chunks, then paste them into another world, save.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions