fixed nullpointer in StringUtils

fixed restarter on Ubuntu spark.file is in spark_home/bin/ not in spark_home/


git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12218 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Wolf Posdorfer
2011-03-30 13:57:40 +00:00
committed by wolf.posdorfer
parent de90ae3c33
commit 033d7bf0f3
2 changed files with 19 additions and 1 deletions

View File

@ -349,7 +349,23 @@ public final class MainWindow extends ChatFrame implements ActionListener {
command = starterExe + " \"" + sparkExe + "\"";
}
else if (Spark.isLinux()) {
File f = Spark.getBinDirectory().getParentFile() ;
String[] list = f.list();
boolean contains =false;
for(String s : list)
{
if (s.equals("spark"))
{
contains=true;
return;
}
}
if(contains){
command = Spark.getBinDirectory().getParentFile().getCanonicalPath() + File.separator + "spark";
}
else{
command = Spark.getBinDirectory().getCanonicalPath() + File.separator + "spark";
}
}
else if (Spark.isMac()) {
command = "open -a Spark";

View File

@ -1944,7 +1944,9 @@ public class StringUtils {
* @author wolf.posdorfer
*/
public static String modifyWildcards(String resource) {
if(resource==null)
return "";
resource = resource.replace("%random%",
"" + Math.round((Math.random() * 1000)));