Changeset 8960 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2015-10-27T23:16:01+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #12018 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java

    r8836 r8960  
    4141            StringBuilder sb = new StringBuilder(24);
    4242            sb.append("<html>");
    43             if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) {
    44                 panel.add(needsUpload, defaultCellStyle);
    45                 sb.append(tr("Layer ''{0}'' has modifications which should be uploaded to the server.", info.getName()));
     43            if (info != null) {
     44                if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) {
     45                    panel.add(needsUpload, defaultCellStyle);
     46                    sb.append(tr("Layer ''{0}'' has modifications which should be uploaded to the server.", info.getName()));
    4647
    47             } else {
    48                 panel.add(pnlEmpty, defaultCellStyle);
    49                 if (info.getLayer().requiresUploadToServer()) {
    50                     sb.append(tr("Layer ''{0}'' has modifications which are discouraged to be uploaded.", info.getName()));
    5148                } else {
    52                     sb.append(tr("Layer ''{0}'' has no modifications to be uploaded.", info.getName()));
     49                    panel.add(pnlEmpty, defaultCellStyle);
     50                    if (info.getLayer().requiresUploadToServer()) {
     51                        sb.append(tr("Layer ''{0}'' has modifications which are discouraged to be uploaded.", info.getName()));
     52                    } else {
     53                        sb.append(tr("Layer ''{0}'' has no modifications to be uploaded.", info.getName()));
     54                    }
    5355                }
    54             }
    55             sb.append("<br/>");
     56                sb.append("<br/>");
    5657
    57             if (info.getLayer().requiresSaveToFile()) {
    58                 panel.add(needsSave, defaultCellStyle);
    59                 sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.",
    60                         info.getName(), info.getFile().toString()));
    61             } else {
    62                 panel.add(pnlEmpty, defaultCellStyle);
    63                 sb.append(tr("Layer ''{0}'' has no modifications to be saved.", info.getName()));
     58                if (info.getLayer().requiresSaveToFile()) {
     59                    panel.add(needsSave, defaultCellStyle);
     60                    sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.",
     61                            info.getName(), info.getFile().toString()));
     62                } else {
     63                    panel.add(pnlEmpty, defaultCellStyle);
     64                    sb.append(tr("Layer ''{0}'' has no modifications to be saved.", info.getName()));
     65                }
    6466            }
    6567            sb.append("</html>");
Note: See TracChangeset for help on using the changeset viewer.