Title: [93606] trunk/Source/WebKit/efl
Revision
93606
Author
[email protected]
Date
2011-08-23 08:48:55 -0700 (Tue, 23 Aug 2011)

Log Message

[EFL] Treat the case of WebCore::History->currentItem() returning NULL.
https://bugs.webkit.org/show_bug.cgi?id=66698

Patch by Raphael Kubo da Costa <[email protected]> on 2011-08-23
Reviewed by Kenneth Rohde Christiansen.

WebCore::History->currentItem() may return NULL, and we'd better treat
it in ewk_history_history_item_current_get itself than propagate the
issue to _ewk_history_item_new.

* ewk/ewk_history.cpp:
(ewk_history_history_item_current_get):
* ewk/ewk_history.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (93605 => 93606)


--- trunk/Source/WebKit/efl/ChangeLog	2011-08-23 15:35:58 UTC (rev 93605)
+++ trunk/Source/WebKit/efl/ChangeLog	2011-08-23 15:48:55 UTC (rev 93606)
@@ -1,5 +1,20 @@
 2011-08-23  Raphael Kubo da Costa  <[email protected]>
 
+        [EFL] Treat the case of WebCore::History->currentItem() returning NULL.
+        https://bugs.webkit.org/show_bug.cgi?id=66698
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        WebCore::History->currentItem() may return NULL, and we'd better treat
+        it in ewk_history_history_item_current_get itself than propagate the
+        issue to _ewk_history_item_new.
+
+        * ewk/ewk_history.cpp:
+        (ewk_history_history_item_current_get):
+        * ewk/ewk_history.h:
+
+2011-08-23  Raphael Kubo da Costa  <[email protected]>
+
         [EFL] Add auxiliary history functions for DRT
         https://bugs.webkit.org/show_bug.cgi?id=66700
 

Modified: trunk/Source/WebKit/efl/ewk/ewk_history.cpp (93605 => 93606)


--- trunk/Source/WebKit/efl/ewk/ewk_history.cpp	2011-08-23 15:35:58 UTC (rev 93605)
+++ trunk/Source/WebKit/efl/ewk/ewk_history.cpp	2011-08-23 15:48:55 UTC (rev 93606)
@@ -153,7 +153,10 @@
 Ewk_History_Item* ewk_history_history_item_current_get(const Ewk_History* history)
 {
     EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
-    return _ewk_history_item_new(core->currentItem());
+    WebCore::HistoryItem *currentItem = core->currentItem();
+    if (currentItem)
+        return _ewk_history_item_new(currentItem);
+    return 0;
 }
 
 Ewk_History_Item* ewk_history_history_item_forward_get(const Ewk_History* history)

Modified: trunk/Source/WebKit/efl/ewk/ewk_history.h (93605 => 93606)


--- trunk/Source/WebKit/efl/ewk/ewk_history.h	2011-08-23 15:35:58 UTC (rev 93605)
+++ trunk/Source/WebKit/efl/ewk/ewk_history.h	2011-08-23 15:48:55 UTC (rev 93606)
@@ -110,8 +110,8 @@
  *
  * @param history which history instance to query.
  *
- * @return the @b newly allocated item instance. This memory must be
- *         released with ewk_history_item_free() after use.
+ * @return the @b newly allocated item instance or @c NULL on error. This memory
+ *         must be released with ewk_history_item_free() after use.
  */
 EAPI Ewk_History_Item *ewk_history_history_item_current_get(const Ewk_History *history);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to