Drawbot in Glyphs keeps crashing

Glyphs crashes after running a script that writes a PDF file from Drawbot window,
Script seems to finish, I scroll in the graphical output panel or the code and – it just closes.

Crash report says “libobjc.A.dylib” crashed

I have python 2.7 installed.
What do?

Can you wrap your code in a try:except: block? If that doesn’t help, can you send me the script?

I pasted the same code in the Makro-Panel of glyphs instead of the Drawbot editor and it runs OK now.

Did you try to add try/except?

I wasn’t able to recreate this big bug yet.
To escape None Type errors (in my case: when glyphs have no unicode), I wrapped some critical functions in try: except: pass.

However: I found something strange:

Traceback (most recent call last):
File “/Users/xxx/Library/Application Support/Glyphs/Plugins/Smiley Palette.glyphsPalette/Contents/Resources/plugin.py”, line 28, in settings
Glyphs.addCallback(self.update, UPDATEINTERFACE)
NameError: global name ‘UPDATEINTERFACE’ is not defined
Traceback (most recent call last):
File “GlyphsApp/plugins.py”, line 841, in init
AttributeError: ‘NoneType’ object has no attribute ‘frame’

I installed that plugin to look at it yesterday. Why does it show up here?

It still crashes the app after execution.

This is the crash report I get

Incident Identifier: 5C96FE5C-1A8F-405D-825D-9D68D688FB8F
CrashReporter Key: F6860447-DEAA-5959-AE2C-636FB3387381
Hardware Model: iMac13,2
Process: Glyphs [6463]
Path: /Applications/Glyphs.app/Contents/MacOS/Glyphs
Identifier: com.GeorgSeifert.Glyphs2
Version: 895
Code Type: X86-64
Parent Process: launchd [1]

Date/Time: 2016-09-07 15:47:03 +0000
OS Version: Mac OS X 10.11.6 (15G1004)
Report Version: 104

Exception Type: SIGSEGV
Exception Codes: SEGV_MAPERR at 0x18
Crashed Thread: 0

Application Specific Information:
Selector name found in current argument registers: valueRestriction

Thread 0 Crashed:
0 libobjc.A.dylib 0x00007fff9148c4dd objc_msgSend + 29

Does it crash with every script?

No, I think its some kind of PyObjC-Error so it is most likely Drawbot-specific. Maybe the drawing function gets the wrong kind of input.