Skip to content

Commit

Permalink
Polish.
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejwalkowiak committed May 7, 2021
1 parent 2bfb639 commit 71eca42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion sentry/src/main/java/io/sentry/SentryEnvelopeItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public final class SentryEnvelopeItem {
}

// TODO: Should be a Stream
// dataFactory is a Callable which returns theoretically a nullable result. Our implementations always provide non-null values.
// dataFactory is a Callable which returns theoretically a nullable result. Our implementations
// always provide non-null values.
@SuppressWarnings("NullAway")
public @NotNull byte[] getData() throws Exception {
if (data == null && dataFactory != null) {
Expand Down
7 changes: 2 additions & 5 deletions sentry/src/main/java/io/sentry/cache/CacheStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void moveInitFlagIfNecessary(
final @NotNull File currentFile, final @NotNull File[] notDeletedFiles) {
final SentryEnvelope currentEnvelope = readEnvelope(currentFile);

if (currentEnvelope != null && !isValidEnvelope(currentEnvelope)) {
if (currentEnvelope == null || !isValidEnvelope(currentEnvelope)) {
return;
}

Expand Down Expand Up @@ -219,10 +219,7 @@ private void moveInitFlagIfNecessary(
return null;
}

private @Nullable Session getFirstSession(final @Nullable SentryEnvelope envelope) {
if (envelope == null) {
return null;
}
private @Nullable Session getFirstSession(final @NotNull SentryEnvelope envelope) {
for (final SentryEnvelopeItem item : envelope.getItems()) {
if (!isSessionType(item)) {
continue;
Expand Down

0 comments on commit 71eca42

Please sign in to comment.