| << Back to previous view | 
                                    
                                [QB-2671] Pipeline view is throwing exception because of getCachedLatestBuild()
                
             | 
        |
| Status: | Resolved | 
| Project: | QuickBuild | 
| Component/s: | None | 
| Affects Version/s: | 6.1.8 | 
| Fix Version/s: | 6.1.9 | 
| Type: | Bug | Priority: | Blocker | 
| Reporter: | AlSt | Assigned To: | Unassigned | 
| Resolution: | Fixed | Votes: | 0 | 
| Remaining Estimate: | Unknown | Time Spent: | Unknown | 
| Original Estimate: | Unknown | ||
| Description | 
| 
                The Pipeline Gadget and also the Pipeline page of a configuration is throwing an exception:
 java.lang.IllegalStateException: Optional.get() cannot be called on an absent value at com.google.common.base.Absent.get(Absent.java:42) at com.pmease.quickbuild.model.Configuration.getCachedLatestBuild(Configuration.java:2133) at java.lang.reflect.Method.invoke(Method.java:497) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:196) at The source code for this is: public Build getCachedLatestBuild() { if (cachedLatestBuild == null) cachedLatestBuild = Optional.fromNullable(getLatestBuild()); return cachedLatestBuild.get(); } Maybe checking also if the optional is empty in the if might make sense?  | 
        
| Comments | 
| Comment by AlSt [ 21/Mar/16 12:24 PM ] | 
| Why are you using Optional there anyway? It is never used for what's it's supposed to be. There is never a check with chachedLatestBuild.isPresent()! |