]> git.ipfire.org Git - pakfire.git/commitdiff
_pakfire: keys: Fix error handling when returning algorithm
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Jun 2023 17:08:17 +0000 (17:08 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Jun 2023 17:08:17 +0000 (17:08 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/key.c

index a25cba29d5d6f5ea3c19c807979588bfe0510901..cd0681305ca0f7e01aea69a7883484fb1c6af89b 100644 (file)
@@ -77,7 +77,7 @@ static PyObject* Key_get_algorithm(KeyObject* self) {
        const char* algorithm = pakfire_key_get_algo(self->key);
 
        // Raise an error on no input
-       if (algorithm) {
+       if (!algorithm) {
                PyErr_SetFromErrno(PyExc_OSError);
                return NULL;
        }