File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/org/opensolaris/opengrok/web Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1210,7 +1210,16 @@ private String getLatestRevision() {
1210
1210
return null ;
1211
1211
}
1212
1212
1213
- HistoryEntry he = hist .getHistoryEntries ().get (0 );
1213
+ List <HistoryEntry > hlist = hist .getHistoryEntries ();
1214
+ if (hlist == null ) {
1215
+ return null ;
1216
+ }
1217
+
1218
+ if (hlist .size () == 0 ) {
1219
+ return null ;
1220
+ }
1221
+
1222
+ HistoryEntry he = hlist .get (0 );
1214
1223
if (he == null ) {
1215
1224
return null ;
1216
1225
}
@@ -1234,12 +1243,17 @@ public boolean isLatestRevision(String rev) {
1234
1243
*/
1235
1244
public String getLatestRevisionLocation () {
1236
1245
StringBuilder sb = new StringBuilder ();
1246
+ String revStr ;
1247
+
1248
+ if ((revStr = getLatestRevision ()) == null ) {
1249
+ return null ;
1250
+ }
1237
1251
1238
1252
sb .append (req .getContextPath ());
1239
1253
sb .append (Prefix .XREF_P );
1240
1254
sb .append (Util .URIEncodePath (path ));
1241
1255
sb .append ("?r=" );
1242
- sb .append (Util .URIEncode (getLatestRevision () ));
1256
+ sb .append (Util .URIEncode (revStr ));
1243
1257
1244
1258
return sb .toString ();
1245
1259
}
You can’t perform that action at this time.
0 commit comments