diff --git a/src/palette/internal/paletteworkspacesetup.cpp b/src/palette/internal/paletteworkspacesetup.cpp index bff9dbb30a..e9e351cd99 100644 --- a/src/palette/internal/paletteworkspacesetup.cpp +++ b/src/palette/internal/paletteworkspacesetup.cpp @@ -86,7 +86,7 @@ void PaletteWorkspaceSetup::setup() auto loadData = [this]() { RetVal data = workspacesDataProvider()->rawData(DataKey::Palettes); PaletteTreePtr tree; - if (data.ret) { + if (data.ret && !data.val.isEmpty()) { LOGD() << "there is palette data in the workspace, we will use it"; ByteArray ba = ByteArray::fromQByteArrayNoCopy(data.val); tree = readPalette(ba); diff --git a/src/workspace/internal/workspace.cpp b/src/workspace/internal/workspace.cpp index 97fa2dc50e..037adc54bb 100644 --- a/src/workspace/internal/workspace.cpp +++ b/src/workspace/internal/workspace.cpp @@ -71,11 +71,6 @@ RetVal Workspace::rawData(const DataKey& key) const return RetVal(make_ret(Err::NotLoaded)); } - QByteArray data = m_file.data(key_to_string(key)); - if (data.isEmpty()) { - return RetVal(make_ret(Err::NoData)); - } - RetVal rv; rv.ret = make_ret(Ret::Code::Ok); rv.val = m_file.data(key_to_string(key)); diff --git a/src/workspace/workspaceerrors.h b/src/workspace/workspaceerrors.h index 960d038e33..0752cff7df 100644 --- a/src/workspace/workspaceerrors.h +++ b/src/workspace/workspaceerrors.h @@ -31,7 +31,6 @@ enum class Err { UnknownError = int(Ret::Code::WorkspaceFirst), NotLoaded = 1502, - NoData = 1503, FailedPack = 1510, FailedUnPack = 1511,