Skip to content

Commit 1dbe84b

Browse files
committed
fix: null pointer condition
In case the backup config is not present the value might be null and fails. The new condition handles it. Signed-off-by: Ales Raszka <araszka@redhat.com>
1 parent 72dc09e commit 1dbe84b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/library/env/workspaceenv.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ func GetEnvironmentVariablesForProjectRestore(workspace *common.DevWorkspaceWith
5757
Name: devfileConstants.ProjectsRootEnvVar,
5858
Value: constants.DefaultProjectsSourcesRoot,
5959
})
60-
if workspace.Config.Workspace.BackupCronJob.OrasConfig != nil {
60+
if workspace.Config.Workspace.BackupCronJob != nil &&
61+
workspace.Config.Workspace.BackupCronJob.OrasConfig != nil {
6162
restoreEnv = append(restoreEnv, corev1.EnvVar{
6263
Name: "ORAS_EXTRA_ARGS",
6364
Value: workspace.Config.Workspace.BackupCronJob.OrasConfig.ExtraArgs,

0 commit comments

Comments
 (0)