diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index d742fb9eb..a71f55dd2 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -839,7 +839,8 @@ public: itBegin = it; } } - s.write((char*)&itBegin[0], it-itBegin); + if (itBegin != scriptCode.end()) + s.write((char*)&itBegin[0], it-itBegin); } /** Serialize an input of txTo */