Commit ae892750 authored by Dominique Marcadet's avatar Dominique Marcadet

Fatal exception if no SCL root element

parent af7eb07b
......@@ -33,14 +33,18 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.LN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SCL;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclObject;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseFatalException;
public class SclUtilities {
public static SCL getSCL( SclObject object ) {
public static @NonNull SCL getSCL( SclObject object ) {
EObject scl = object;
while(( scl != null ) && ! ( scl instanceof SCL )) {
scl = scl.eContainer();
}
if( scl == null ) {
throw new RiseClipseFatalException( "root container is not SCL", null );
}
return ( SCL ) scl;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment