diff --git a/source/application/StarMainApplication_sdl.cpp b/source/application/StarMainApplication_sdl.cpp index 61a2fa2..48b7fa5 100644 --- a/source/application/StarMainApplication_sdl.cpp +++ b/source/application/StarMainApplication_sdl.cpp @@ -460,9 +460,9 @@ private: Maybe getClipboard() override { Maybe string; if (SDL_HasClipboardText()) { - auto text = SDL_GetClipboardText(); - if (text && *text != NULL) { - string.emplace(text); + if (auto text = SDL_GetClipboardText()) { + if (*text != NULL) + string.emplace(text); SDL_free(text); } }