From dad9295d01a8baf2d281fd1d77dc963f4034ea93 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Mon, 18 Jul 2022 20:22:15 -0700 Subject: [PATCH] lib: implement check for empty data buffer Fixes occasional crash --- lib/object.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/object.cpp b/lib/object.cpp index 0c46e0f..dab5736 100644 --- a/lib/object.cpp +++ b/lib/object.cpp @@ -138,6 +138,10 @@ bool Object::ReplaceWithFile(FileBase *f) bool Object::ExtractToFile(FileBase *f) const { + if (data_.empty()) { + return false; + } + switch (this->filetype()) { case MxOb::WAV: {