Skip to content

Commit

Permalink
✔️ Coverity - Dereference null return value
Browse files Browse the repository at this point in the history
  • Loading branch information
evrignaud committed May 11, 2016
1 parent 10d54b4 commit 73b6e1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/main/java/org/fim/internal/StateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ public State loadState(int stateNumber, boolean loadFullState) throws IOExceptio

try {
State state = State.loadFromGZipFile(stateFile, loadFullState);
if (state == null) {
throw new CorruptedStateException();
}

if (loadFullState) {
adjustAccordingToHashMode(state);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/fim/model/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public static State loadFromGZipFile(Path stateFile, boolean loadFullState) thro
try (Reader reader = new InputStreamReader(new GZIPInputStream(new FileInputStream(stateFile.toFile())))) {
Gson gson = new Gson();
State state = gson.fromJson(reader, State.class);
if (state == null) {
throw new CorruptedStateException();
}

if (loadFullState) {
if (!CURRENT_MODEL_VERSION.equals(state.getModelVersion())) {
Expand Down

0 comments on commit 73b6e1d

Please sign in to comment.