Changeset 395d94136077cb4e33b7dc624a10453af047b912

Show
Ignore:
Timestamp:
06/04/07 18:50:30 (1 year ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1180975830 +0200
git-parent:

[5202bc28d0a5387338e90d544b69a92dffcdffa2]

git-author:
Christopher Jung <bktheg@web.de> 1180975118 +0200
Message:

Moegliche Exception gefixt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/framework/bbcode/TagResource.java

    r2c26050 r395d941  
    1818 */ 
    1919package net.driftingsouls.ds2.server.framework.bbcode; 
     20 
     21import java.util.Iterator; 
    2022 
    2123import net.driftingsouls.ds2.server.cargo.Cargo; 
     
    8486                        cargo.setOption( Cargo.Option.SHOWMASS, false ); 
    8587         
     88                        StringBuilder tmpString = new StringBuilder(30); 
     89                         
    8690                        ResourceList reslist = cargo.getResourceList(); 
    87                         ResourceEntry res = reslist.iterator().next(); 
    88                          
    89                         StringBuilder tmpString = new StringBuilder(30); 
    90          
    91                         if( count != 0 ) { 
    92                                 tmpString.append(Common.ln(count)); 
    93                                 tmpString.append("x "); 
     91                        Iterator<ResourceEntry> iter = reslist.iterator(); 
     92                        if( iter.hasNext() ) { 
     93                                ResourceEntry res = iter.next(); 
     94                 
     95                                if( count != 0 ) { 
     96                                        tmpString.append(Common.ln(count)); 
     97                                        tmpString.append("x "); 
     98                                } 
     99                 
     100                                if( format.indexOf('i') != -1 ) { 
     101                                        tmpString.append("<img align=\"middle\" border=\"0\" src=\""); 
     102                                        tmpString.append(res.getImage()); 
     103                                        tmpString.append("\" alt=\"\" />"); 
     104                                } 
     105                 
     106                                if( format.indexOf('n') != -1 ) { 
     107                                        tmpString.append(res.getName()); 
     108                                } 
    94109                        } 
    95          
    96                         if( format.indexOf('i') != -1 ) { 
    97                                 tmpString.append("<img align=\"middle\" border=\"0\" src=\""); 
    98                                 tmpString.append(res.getImage()); 
    99                                 tmpString.append("\" alt=\"\" />"); 
     110                        else { 
     111                                tmpString.append("Fehlerhafte Resource '"+rid+"'"); 
    100112                        } 
    101          
    102                         if( format.indexOf('n') != -1 ) { 
    103                                 tmpString.append(res.getName()); 
    104                         } 
    105                          
    106113 
    107114                        return tmpString.toString();