Skip to content
Permalink
Browse files
[JENKINS-51179] - Check type of the loaded object when loading finger…
…prints
  • Loading branch information
oleg-nenashev committed May 13, 2018
1 parent cc94250 commit 922617509eccbcb89ad3bb8b5f6e33bd5a8182c0
Showing with 6 additions and 1 deletion.
  1. +6 −1 core/src/main/java/hudson/model/Fingerprint.java
@@ -1366,7 +1366,12 @@ public Api getApi() {
start = System.currentTimeMillis();

try {
Fingerprint f = (Fingerprint) configFile.read();
Object loaded = configFile.read();
if (!(loaded instanceof Fingerprint)) {
throw new IOException("Unexpected Fingerprint type. Expected " + Fingerprint.class + " or subclass but got "
+ (loaded != null ? loaded.getClass() : "null"));
}
Fingerprint f = (Fingerprint) loaded;
if(logger.isLoggable(Level.FINE))
logger.fine("Loading fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
if (f.facets==null)

0 comments on commit 9226175

Please sign in to comment.