提交 44ecadd2 编写于 作者: E Eduardo Ramos

Fix #1810 GephiFormatException can cause ArrayIndexOutOfBoundsException: 0

上级 69e74804
......@@ -38,7 +38,7 @@ made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
*/
package org.gephi.project.io;
import org.openide.util.NbBundle;
......@@ -83,8 +83,15 @@ public class GephiFormatException extends RuntimeException {
Object[] params = new Object[4];
params[0] = cause.getClass().getSimpleName();
params[1] = cause.getLocalizedMessage();
params[2] = cause.getStackTrace()[0].getClassName();
params[3] = cause.getStackTrace()[0].getLineNumber();
StackTraceElement[] stackTrace = cause.getStackTrace();
if (stackTrace != null && stackTrace.length > 0) {
params[2] = stackTrace[0].getClassName();
params[3] = stackTrace[0].getLineNumber();
} else {
params[2] = "Unknown";
params[3] = "Unknown";
}
if (isImport) {
return String.format(NbBundle.getMessage(GephiFormatException.class, "gephiFormatException_import"), params);
......
......@@ -2,6 +2,6 @@ Manifest-Version: 1.0
AutoUpdate-Essential-Module: true
OpenIDE-Module-Layer: org/gephi/project/api/layer.xml
OpenIDE-Module-Localizing-Bundle: org/gephi/project/api/Bundle.properties
OpenIDE-Module-Specification-Version: ${gephi.modules.specification.version}
OpenIDE-Module-Specification-Version: 0.9.2.1
OpenIDE-Module-Display-Category: Gephi Core
OpenIDE-Module-Name: Project API
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册