Skip to content

Commit cbbe063

Browse files
author
Sergey Firsov
committed
Fix a potential null dereference and potential race conditions
1 parent dbaf720 commit cbbe063

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added null checks and synchronizations.
0 Bytes
Binary file not shown.

src/CommunityCommons/javasource/communitycommons/Misc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ public abstract static class IterateCallback<T1, T2> {
6363

6464
public abstract void hit(T1 key, T2 value) throws Exception;
6565

66-
public void exit() {
66+
synchronized public void exit() {
6767
stop = true;
6868
}
6969

70-
public void remove() {
70+
synchronized public void remove() {
7171
mapIter.remove();
7272
}
7373

src/CommunityCommons/javasource/communitycommons/actions/GetImageDimensions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ public IMendixObject executeAction() throws Exception
3838
ImageDimensions imageDimensions = new ImageDimensions(getContext());
3939
try (InputStream inputStream = Core.getImage(getContext(), this.ImageParameter.getMendixObject(), false)) {
4040
BufferedImage bimg = ImageIO.read(inputStream);
41-
imageDimensions.setHeight(bimg.getHeight());
42-
imageDimensions.setWidth(bimg.getWidth());
41+
if (bimg != null) {
42+
imageDimensions.setHeight(bimg.getHeight());
43+
imageDimensions.setWidth(bimg.getWidth());
44+
}
4345
}
4446

4547
return imageDimensions.getMendixObject();

0 commit comments

Comments
 (0)