Skip to content

Commit

Permalink
2066-fix-open-file-on-500-error-pages-for-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Rettig authored and asolntsev committed Oct 20, 2016
1 parent d94a56c commit d396810
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion framework/src/play/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import play.Play;
import play.mvc.Scope;
import play.vfs.VirtualFile;

import java.lang.annotation.Annotation;
import java.net.URLDecoder;
Expand Down Expand Up @@ -64,7 +65,10 @@ public static String toString(Annotation[] values) {

public static String open(String file, Integer line) {
if (Play.configuration.containsKey("play.editor")) {
return String.format(Play.configuration.getProperty("play.editor"), Play.getFile(file).getAbsolutePath(), line);
VirtualFile vfile = VirtualFile.fromRelativePath(file);
if (vfile != null) {
return String.format(Play.configuration.getProperty("play.editor"), vfile.getRealFile().getAbsolutePath(), line);
}
}
return null;
}
Expand Down

0 comments on commit d396810

Please # to comment.