Page 1 of 1

paragraph (or else) properties ex NullPointerException

PostPosted: Thu Sep 01, 2011 9:25 am
by naked11
hi,
is easiest solution to get for example font size value from style and if dont exist attribute font size dont got exception NullPointerException?

I solve it by this, but I believe, that is easier way.


//code

if (checkRPFont(style)).....

private static boolean checkRPSize(Style style) {
if (style.getRPr() != null) {
if (style.getRPr().getSz() != null) {
return true;
}
}
return false;
}

thanx