X-1.0rc3: IDE: Loading Sikuli project with missing images triggers NullPointerException --- use r930

Bug #1053438 reported by Joost
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Released
Critical
RaiMan

Bug Description

In Sikuli X-1.0 RC3 (r905):

The editor breaks when I try to load a file that references a missing PNG image.

Simplest file I found that reproduces this is:

find("1342447237817.png")

After it breaking, I notice two things:
 - The title is not loaded: is is still "Unnamed" (or whatever translated to the Dutch word "Naamloos")
 - No image is loaded after the missing link

On a side note, some minor bugs:

- Saving an existing project to a different name will duplicate the <old name>.sikul and the <new name>.sikuli and html files in the new folder. (on W7, 64 bits).
- The editor will also load a new 'Unnamed file', even when other files are still open (so I find an extra"Unnamed" tab when I restart the editor).
- Due to cutting and pasting some code (which contained an image) in the Sikuli editor, saving the file and then re-opening will give a NullPointerException. Cleaning up the images is a little bit too rigorous. If there would be any other (non-related) PNG files in the directory, these would also be deleted. Is it an idea to include the option that Sikuli does NOT clean up the PNG files?

Exception trace reported by Sikuli:

java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.sikuli.ide.SikuliIDE$MenuAction.actionPerformed(SikuliIDE.java:1065)
 at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
 at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
 at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
 at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
 at javax.swing.AbstractButton.doClick(Unknown Source)
 at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
 at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
 at java.awt.Component.processMouseEvent(Unknown Source)
 at javax.swing.JComponent.processMouseEvent(Unknown Source)
 at java.awt.Component.processEvent(Unknown Source)
 at java.awt.Container.processEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
 at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
 at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Window.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
 at java.awt.EventQueue.access$000(Unknown Source)
 at java.awt.EventQueue$1.run(Unknown Source)
 at java.awt.EventQueue$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
 at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
 at java.awt.EventQueue$2.run(Unknown Source)
 at java.awt.EventQueue$2.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
 at org.sikuli.ide.ImageButton.createFromString(ImageButton.java:241)
 at org.sikuli.ide.SikuliPane.replaceWithImage(SikuliPane.java:617)
 at org.sikuli.ide.SikuliPane.parseLine(SikuliPane.java:568)
 at org.sikuli.ide.SikuliPane.parseRange(SikuliPane.java:528)
 at org.sikuli.ide.SikuliPane.parse(SikuliPane.java:543)
 at org.sikuli.ide.SikuliPane.parse(SikuliPane.java:546)
 at org.sikuli.ide.SikuliPane.read(SikuliPane.java:427)
 at org.sikuli.ide.SikuliPane.loadFile(SikuliPane.java:372)
 at org.sikuli.ide.SikuliPane.loadFile(SikuliPane.java:383)
 at org.sikuli.ide.SikuliIDE$FileAction.doLoad(SikuliIDE.java:1411)
 ... 43 more

Tags: idestartup
Revision history for this message
RaiMan (raimund-hocke) wrote :

--- not existing image
try version r930 from http://sikuli.org/download.shtml

I think it is fixed there.

Revision history for this message
RaiMan (raimund-hocke) wrote :

I think, the "cut/copy and paste including images" works as well with r930

summary: - Loading Sikuli project with missing images triggers NullPointerException
+ X-1.0rc3: IDE: Loading Sikuli project with missing images triggers
+ NullPointerException --- use r930
Changed in sikuli:
status: New → Fix Committed
Revision history for this message
Joost (joostvanpinxten) wrote :

You're saving the day once again, pointing people (me) to where they should look. I overlooked the 930 release, as the 905 is still prominently visible as installer.

Cut, then save, then paste gives me the following error:

[error] Can't transfer: sun.awt.datatransfer.TransferableProxy@1a256c7

Should I create another bug report?

Revision history for this message
RaiMan (raimund-hocke) wrote :

Uuups, did not see this before.

What system, what Java?

Revision history for this message
RaiMan (raimund-hocke) wrote :

I just looked into the source - only 10 statements in try-catch block (unfortunately the error itself is not displayed :-(

It is the part, where the images are copied from one .sikuli to the other.

So this scenario makes a problem:
- cut something with an image included
- save the script (the image is deleted, because no longer referenced - LOL)
- paste somewhere else: the image to copy cannot be found

If this is what you have done:
just paste before you save ;-)

You might post a bug about that (but pls. describe the workaround ;-)

RaiMan (raimund-hocke)
Changed in sikuli:
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
importance: Undecided → Low
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → x1.0
RaiMan (raimund-hocke)
tags: added: idestartup
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Low → Critical
RaiMan (raimund-hocke)
Changed in sikuli:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.