diff --git a/cli/kdeconnect-cli.cpp b/cli/kdeconnect-cli.cpp index fa9bf1090..517700280 100644 --- a/cli/kdeconnect-cli.cpp +++ b/cli/kdeconnect-cli.cpp @@ -183,6 +183,11 @@ int main(int argc, char** argv) parser.showHelp(1); } + if (!blockOnReply(iface.devices(false, false)).contains(device)) { + QTextStream(stderr) << "Couldn't find device with id \"" << device << "\". To specify a device by name use -n " << endl; + return 1; + } + if (parser.isSet(QStringLiteral("share"))) { QStringList urls;