Skip to content

Commit

Permalink
[356] Fix Optional.orElseGet(null) leading to systematic error
Browse files Browse the repository at this point in the history
Bug: #356
Signed-off-by: Glenn Plouhinec <[email protected]>
  • Loading branch information
GlennPlou authored and pcdavid committed Jul 31, 2024
1 parent 8f384d8 commit c830908
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2020 Obeo
* Copyright (c) 2018, 2024 Obeo
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -65,7 +65,7 @@ public LayoutProviderData(DefaultLayoutProvider defaultLayoutProvider, boolean s
@Override
public AbstractLayoutEditPartProvider getLayoutNodeProvider(final IGraphicalEditPart partToLayout) {
AbstractLayoutEditPartProvider result = null;
LayoutProviderData layoutProviderData = Optional.ofNullable(editPartToLayoutProviderCache.get(partToLayout)).orElseGet(() -> getLayoutProviderData(partToLayout).orElseGet(null));
LayoutProviderData layoutProviderData = Optional.ofNullable(editPartToLayoutProviderCache.get(partToLayout)).orElseGet(() -> getLayoutProviderData(partToLayout).orElse(null));
if (layoutProviderData != null) {
final CompoundLayoutProvider clp = new CompoundLayoutProvider();
clp.addProvider(layoutProviderData.defaultLayoutProvider);
Expand Down

0 comments on commit c830908

Please sign in to comment.