fix a segfault in edscript() introduced by my previous commit Found by our cherrypick regression tests.