Changeset 12105


Ignore:
Timestamp:
2006-07-07T14:27:11+12:00 (18 years ago)
Author:
mdewsnip
Message:

No longer dies a miserable death when trying to load an image that doesn't exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/util/JarTools.java

    r10013 r12105  
    3232import java.net.*;
    3333import javax.swing.*;
     34import org.greenstone.gatherer.DebugStream;
    3435
    3536
     
    8889    static public ImageIcon getImage(String filename, boolean wait_until_complete)
    8990    {
    90     ImageIcon image = new ImageIcon(root_class.getResource("/images/" + filename));
     91    ImageIcon image = null;
     92    try {
     93        image = new ImageIcon(root_class.getResource("/images/" + filename));
     94    }
     95    catch (NullPointerException exception) {
     96        System.err.println("Error: Could not load image " + filename);
     97        DebugStream.println("Error: Could not load image " + filename);
     98    }
     99
    91100    if (image == null) {
    92101        image = ERROR_ICON;
Note: See TracChangeset for help on using the changeset viewer.