[gnome-builder/gnome-builder-43] libide/vcs: handle NULL cloner



commit 579b15c6ae1671d6a35af0f9acf5ca8cd01fdeba
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 11 15:11:48 2022 -0500

    libide/vcs: handle NULL cloner
    
    This can happen if the git plugin is disabled.

 src/libide/vcs/ide-vcs-clone-request.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/vcs/ide-vcs-clone-request.c b/src/libide/vcs/ide-vcs-clone-request.c
index c134b1a4c..bbc6eb919 100644
--- a/src/libide/vcs/ide-vcs-clone-request.c
+++ b/src/libide/vcs/ide-vcs-clone-request.c
@@ -533,7 +533,10 @@ ide_vcs_clone_request_validate (IdeVcsCloneRequest *self)
   g_autoptr(IdeVcsUri) uri = NULL;
 
   g_return_val_if_fail (IDE_IS_VCS_CLONE_REQUEST (self), 0);
-  g_return_val_if_fail (IDE_IS_VCS_CLONER (self->cloner), 0);
+  g_return_val_if_fail (!self->cloner || IDE_IS_VCS_CLONER (self->cloner), 0);
+
+  if (self->cloner == NULL)
+    return IDE_VCS_CLONE_REQUEST_INVAL_URI;
 
   if (ide_str_empty0 (self->uri) || !ide_vcs_uri_is_valid (self->uri))
     flags |= IDE_VCS_CLONE_REQUEST_INVAL_URI;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]