commit 1b843fcb630331c6250be154bdca519c3117386c
Author: Cole Robinson <crobinso@redhat.com>
Date:   Wed Feb 29 13:10:43 2012 -0500

    Fix pitivi startup if it encounters an unexpected stream type
    
    For example, if we have gstreamer-plugins-entrans installed on fedora 16,
    pitivi sees a stream_type application which it doesn't handle, producing:
    
    Traceback (most recent call last):
      File "./installdir/bin/pitivi", line 134, in <module>
        _run_pitivi()
      File "./installdir/bin/pitivi", line 129, in _run_pitivi
        sys.exit(ptv.main(sys.argv))
      File "pitivi/application.py", line 514, in main
        ptv = StartupWizardGuiPitivi(debug=options.debug)
      File "pitivi/application.py", line 371, in __init__
        FullGuiPitivi.__init__(self, debug)
      File "pitivi/application.py", line 264, in __init__
        InteractivePitivi.__init__(self, debug)
      File "pitivi/application.py", line 212, in __init__
        Pitivi.__init__(self)
      File "pitivi/application.py", line 128, in __init__
        self.effects = EffectsHandler()
      File "pitivi/effects.py", line 123, in __init__
        self._setAllEffects()
      File "pitivi/effects.py", line 141, in _setAllEffects
        added = self.addStreams(element_factory, effect)
      File "pitivi/effects.py", line 189, in addStreams
        stream = get_stream_for_pad(pad)
      File "pitivi/stream.py", line 373, in get_stream_for_pad
        stream.pad_id = pad_id
    AttributeError: 'NoneType' object has no attribute 'pad_id'

diff --git a/pitivi/effects.py b/pitivi/effects.py
index 266c26c..520cbb0 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -187,9 +187,13 @@ class EffectsHandler(object):
 
             if padTmp.direction == gst.PAD_SRC:
                 stream = get_stream_for_pad(pad)
+                if not stream:
+                    continue
                 factory.addInputStream(stream)
             elif padTmp.direction == gst.PAD_SINK:
                 stream = get_stream_for_pad(pad)
+                if not stream:
+                    continue
                 factory.addOutputStream(stream)
         return True
 
diff --git a/pitivi/stream.py b/pitivi/stream.py
index bedf454..0ec3a18 100644
--- a/pitivi/stream.py
+++ b/pitivi/stream.py
@@ -370,6 +370,8 @@ def get_stream_for_pad(pad, store_pad=False):
         caps = pad.get_caps()
     pad_id = get_pad_id(pad)
     stream = get_stream_for_caps(caps, pad)
+    if not stream:
+        return None
     stream.pad_id = pad_id
     if store_pad:
         stream.pad = pad
