svn commit: r13105 - trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mvw
Date: 2007-07-22 02:37:15-0700
New Revision: 13105
Modified:
trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Log:
Fix a nullpointer exception when loading a project.
Modified: trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=13105&p1=trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=13104&r2=13105
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java 2007-07-22 02:37:15-0700
@@ -1272,15 +1272,17 @@
nameFig.setText(notationProviderName.toString(
getOwner(), npArguments));
Project p = getProject();
- ProjectSettings ps = p.getProjectSettings();
- showBoldName = ps.getShowBoldNamesValue();
- if ((nameFig.getFont().getStyle() & Font.ITALIC) != 0) {
- nameFig.setFont(showBoldName ? BOLD_ITALIC_LABEL_FONT
- : ITALIC_LABEL_FONT);
- } else {
- nameFig
- .setFont(showBoldName ? BOLD_LABEL_FONT
- : LABEL_FONT);
+ if (p != null) {
+ ProjectSettings ps = p.getProjectSettings();
+ showBoldName = ps.getShowBoldNamesValue();
+ if ((nameFig.getFont().getStyle() & Font.ITALIC) != 0) {
+ nameFig.setFont(showBoldName ? BOLD_ITALIC_LABEL_FONT
+ : ITALIC_LABEL_FONT);
+ } else {
+ nameFig
+ .setFont(showBoldName ? BOLD_LABEL_FONT
+ : LABEL_FONT);
+ }
}
updateBounds();
}