Don't call gtk_selection_data_get_length on nullptr

This commit is contained in:
Ilya Fedin 2021-07-08 22:34:34 +04:00 committed by John Preston
parent 2c6e4eed19
commit 62fd968409

View file

@ -110,7 +110,7 @@ std::vector<uchar> GetImageFromClipboard() {
for (const auto &format : supportedFormats) {
if (auto result = GtkSelectionDataPointer(
gtk_clipboard_wait_for_contents(clipboard, format))
; gtk_selection_data_get_length(result.get()) > 0) {
; result && gtk_selection_data_get_length(result.get()) > 0) {
return result;
}
}